教程集 www.jiaochengji.com
教程集 >  脚本编程  >  Asp  >  正文 asp网页自动刷新方法汇总

asp网页自动刷新方法汇总

发布时间:2014-07-20   编辑:jiaochengji.com
本文介绍了asp\html页面中实现网页自动刷新的方法,一些自动刷新页面的小例子,有需要的朋友参考下。

本节内容:
自动刷新页面方法总结

参考如下:
1),<meta http-equiv="refresh" content="10">
10表示间隔10秒刷新一次

2),<script>
window.location.reload(true);
</script>
如果是你要刷新某一个iframe就把window给换成frame的名字或ID号

3),<script>
window.navigate("本页面url");
 

复制代码 代码示例:
</script>
function abc()
{
window.location.href="/blog/window.location.href";
setTimeout("abc()",10000);
}
 

刷新本页:
Response.Write("<script>window.location.href=window.location.href;</script>")
刷新父页:
Response.Write("<script>opener.location.href=opener.location.href;</script>")
转到指定页:
Response.Write("<script>window.location.href='yourpage.aspx';</script>")
刷新页面实现方式总结(HTML,ASP,JS)
定时刷新:
<script>setTimeout("location.href='url'",2000)</script>
说明:url是要刷新的页面URL地址
2000是等待时间=2秒,

2.
说明:
n is the number of seconds to wait before loading the specified URL.
url is an absolute URL to be loaded.
n,是等待的时间,以秒为单位
url是要刷新的页面URL地址

3.
说明:一般用一个url参数或者表单传值判断是否发生某个操作,然后利用response.redirect 刷新。

4.
刷新框架页
 

复制代码 代码示例:
<script language=javascript>top.leftFrm.location.reload();parent.frmTop.location.reload(); 弹出窗体后再刷新的问题
Response.Write("<script>window.showModalDialog('../OA/SPCL.aspx',window,'dialogHeight: 300px; dialogWidth: 427px; dialogTop: 200px; dialogLeft: 133px')</script>");//open
Response.Write("<script>document.location=document.location;</script>");
 

在子窗体页面代码head中加入刷新的内容加在 if (!IsPostBack) 中

在框架页中右面刷新左面
 

复制代码 代码示例:

//刷新框架页左半部分

Response.Write("<script>");
Response.Write("parent.left.location.href='PayDetailManage_Left.aspx'");
Response.Write("</script>");
 

页面定时刷新功能实现

有三种方法:
1,在html中设置:
之後加入下面这一行即可!
定时刷新:
10代表刷新间隔,单位为秒

2.jsp
<!--esponse.setHeader("refresh","1");-->
每一秒刷新一次

3.使用javascript:
<script>
setTimeout("self.location.reload();",1000);
<script>
一秒一次

您可能感兴趣的文章:
asp网页自动刷新方法汇总
js自动刷新页面代码汇总
js刷新页面方法汇总
asp.net 清除IE页面缓存的方法
javascript刷新当前页面方法汇总
网页页面自动刷新三种方法
js返回上一页并刷新的几种方法
js自动刷新当前页面方法详解
js刷新页面实例解析
网页自动刷新怎么实现

关键词: 刷新页面  网页自动刷新   
[关闭]
~ ~