首页 > Other > Javascript刷新全集

Javascript刷新全集

一:刷新本页面

前台:<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.cnblogs.com/yooolonet/‘;</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.cnblogs.com/yooolonet/”;setTimeout(“flash()”,1000);} //1000为一秒

<script>setTimeout(“location.href=http://www.cnblogs.com/yooolonet/“,2000)</script>

<script>setTimeout(“self.location.reload();”,1000);<script>一秒一次

分类:Other
  1. 还没有评论。
  1. No trackbacks yet.

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: