Javascript 刷新全集常用代码

时间:2009-11-22    点击:75   
一:刷新本页面
前台:<script>window.location.href=window.location.href;</script>
后台:Response.Write("<script>window.location.href=window.location.href;</script>")
二:刷新父页面
前台:opener.location.href=opener.location.href;</script>
后台:Response.Write("<script>opener.location.href=opener.location.href;</script>")
三:链接到指定网页
前台:<script>window.location.href='http://www.jb51.net';</script>
  MSDN说的window.navigate(sURL)方法是针对IE的,不适用于FF,在HTML DOM Window Object中,根本没有列出window.navigate方法。
后台:Response.Write("<script>window.location.href='yourpage.aspx';</script>")
  或者: Response.Write("NewUrl");
四:刷新Iframe
前台:<script>iframe名字或者ID.location.reload(true);</script>

五:定时刷新
function flash(){window.location.href="http://www.jb51.net";setTimeout("flash()",1000);} //1000为一秒
<script>setTimeout("location.href=http://www.jb51.net",2000)</script>
<script>setTimeout("self.location.reload();",1000);<script>一秒一次
写出更好的JavaScript程序之undefined篇(中)
通过身份证号得到出生日期和性别的js代码
javascript 在网页中的运用(asp.net)
javascript DOM编程实例(智播客学习)
传智播客学习之java 反射
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved