functionabc(){window.location.href="/blog/window.location." />
页面自动刷新代码大全,基本上所有要求自动刷新页面的代码都有,大家可以自由发挥做出完美的页面。
1)
10表示间隔10秒刷新一次
2)
window.location.reload(true);
如果是你要刷新某一个iframe就把window给换成frame的名字或ID号
3)
window.navigate("本页面url");
4>
function abc()
{
window.location.href="/blog/window.location.href";
setTimeout("abc()",10000);
}
刷新本页:
Response.Write("")
刷新父页:
Response.Write("")
转到指定页:
Response.Write("")
刷新页面实现方式总结(HTML,ASP,JS)
'by aloxy
定时刷新:
1,
说明: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("");//open Response.Write("");
在子窗体页面代码head中加入
刷新的内容加在if (!IsPostBack) 中
在框架页中右面刷新左面
//刷新框架页左半部分
Response.Write("");
页面定时刷新功能实现
有三种方法:
1,在html中设置:
之后加入下面这一行即可!
定时刷新:
10代表刷新间隔,单位为秒
2.jsp
每一秒刷新一次
3.使用javascript:
setTimeout("self.location.reload();",1000);
一秒一次
页面自动跳转:
window.location.href="mian.aspx";
history.go(0);//window.close(); //关闭浏览器此页的窗口
先来看一个简单的例子:
下面以三个页面分别命名为frame.html、top.html、bottom.html为例来具体说明如何做。
frame.html 由上(top.html)下(bottom.html)两个页面组成,代码如下:
现在假设top.html (即上面的页面) 有七个button来实现对bottom.html (即下面的页面) 的刷新,可以用以下七种语句,哪个好用自己看着办了。
语句1. window.parent.frames[1].location.reload();
语句2. window.parent.frames.bottom.location.reload();
语句3. window.parent.frames["bottom"].location.reload();
语句4. window.parent.frames.item(1).location.reload();
语句5. window.parent.frames.item('bottom').location.reload();
语句6. window.parent.bottom.location.reload();
语句7. window.parent['bottom'].location.reload();
top.html 页面的代码如下:
onclick="window.parent.frames[1].location.reload()">
onclick="window.parent.frames.bottom.location.reload()">
onclick="window.parent.frames['bottom'].location.reload()">
onclick="window.parent.frames.item(1).location.reload()">
onclick="window.parent.frames.item('bottom').location.reload()">
onclick="window.parent['bottom'].location.reload()">
下面是bottom.html页面源代码,为了证明下方页面的确被刷新了,在装载完页面弹出一个对话框。
bottom.html 页面的代码如下:
解释一下:
1.window指代的是当前页面,例如对于此例它指的是top.html页面。
2.parent指的是当前页面的父页面,也就是包含它的框架页面。例如对于此例它指的是framedemo.html。
3.frames是window对象,是一个数组。代表着该框架内所有子页面。
4.item是方法。返回数组里面的元素。
5.如果子页面也是个框架页面,里面还是其它的子页面,那么上面的有些方法可能不行。
附:
Javascript刷新页面的几种方法:
1 history.go(0)
2 location.reload()
3 location=location
4 location.assign(location)
5 document.execCommand('Refresh')
6 window.navigate(location)
7 location.replace(location)
8 document.URL=location.href
自动刷新页面的方法:
1.页面自动刷新:把如下代码加入
区域中其中20指每隔20秒刷新一次页面.
2.页面自动跳转:把如下代码加入
区域中其中20指隔20秒后跳转到https://www.wendangku.net/doc/b19398922.html,页面
3.页面自动刷新js版
function myrefresh()
{
window.location.reload();
}
setTimeout('myrefresh()',1000); //指定1秒刷新一次
https://www.wendangku.net/doc/b19398922.html,如何输出刷新父窗口脚本语句
1. this.response.write("");
2. this.response.write("");
3. Response.Write("")
JS刷新框架的脚本语句
//如何刷新包含该框架的页面用
parent.location.reload();
//子窗口刷新父窗口
self.opener.location.reload();
( 或刷新 )
//如何刷新另一个框架的页面用
parent.另一FrameID.location.reload();
如果想关闭窗口时刷新或者想开窗时刷新的话,在
中调用以下语句即可。 开窗时刷新 关闭时刷新window.opener.document.location.reload()
1. Javascript 返回上一页 history.go(-1), 返回两个页面: history.go(-2); 2. history.back(). 3. window.history.forward()返回下一页 4. window.history.go(返回第几页,也可以使用访问过的URL) 例: 向上一页 response.Write("") response.Write("") 向上一页 页面跳转:onclick="window.location.href='list.aspx'" P.S. 小技巧(JS引用JS): Javascript刷新页面的几种方法: 1 history.go(0) 2 location.reload() 3 location=location 4 location.assign(location) 5 document.execCommand('Refresh') 6 window.navigate(location) 7 location.replace(location) 8 document.URL=location.href 自动刷新页面的方法: 1.页面自动刷新:把如下代码加入
区域中 其中20指每隔20秒刷新一次页面.window.location.reload();页面实现跳转和刷新 1 history.go(0) 2 location.reload() 3 location=location 4 location.assign(location) 5 document.execCommand('Refresh') 6 window.navigate(location) 7 location.replace(location) 8 document.URL=location.href 这几个都可以刷新 window.location.reload();刷新
window.location.href=window.location.href;刷新 window.close();关闭窗口,不弹出系统提示,直接关闭 window.close()相当于self属性是当前窗口 window.parent.close()是parent属性是当前窗口或框架的框架组 页面实现跳转的九种方法实例: <html> < head> < meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> < title>navigate</title> < script language="javascript">
setTimeout('window.navigate("top.html");',2000); setTimeout('window.document.location.href="top.html";',20 00); setTimeout('window.document.location="top.html";',2000); setTimeout('window.location.href="top.html";',2000); setTimeout('window.location="top.html";',2000); setTimeout('document.location.href="top.html";',2000); setTimeout('document.location="top.html";',2000); setTimeout('location.href="top.html";',2000); setTimeout('location.replace("top.html")',2000);
经常上网的朋友可能到过这样一些网站,一进入首页立刻会弹出一个窗口,或者按一个链接或按钮弹出,通常在这个窗口里会显示一些注意事项、版权信息、警告、欢迎光顾之类的话或者作者想要特别提示的信息。其实制作这样的页面非常容易,只要往该页面的HTML里加入几段javascript代码即可实现。下面我就带你剖析它的奥秘。 【最基本的弹出窗口代码】 其实代码非常简单: 因为这是一段javascript代码,所以它们应该放在之间。是对一些版本低的浏览器起作用,在这些老浏览器中如果不支持javascript,不会将标签中的代码作为文本显示出来。 Window.open ('page.html')用于控制弹出新的窗口page.html,如果page.html不与主窗口在同一路径下,前面应写明路径,绝对路径(http://)和相对路径(../)均可。 用单引号和双引号都可以,只是不要混用。 这一段代码可以加入HTML的任意位置,加入到
和之间也可以,位置越靠前执行越早,尤其是页面代码较长时,又想使页面早点弹出就尽量往前放。 【经过设置后的弹出窗口】 下面再说一说弹出窗口外观的设置。只要再往上面的代码中加一点东西就可以了。 我们来定制这个弹出窗口的外观、尺寸大小、弹出位置以适应该页面的具体情况。