您的位置:首页 > 编程语言

页面自动刷新代码

2013-01-10 17:47 232 查看
1、cs文件中:

1)Response.Write("<script>window.location.href=window.location.href;</script>");//刷新本页面。

  2)Response.Write("<script>opener.location.href=opener.location.href;</script>");刷新父页。

  3)Response.Write("<script>window.location.href='yourpage.aspx';</script>");转到指定页。

  4)

2、js实现:

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

  2)<script> window.navigate("本页面url"); </script>

  3)  function abc()
  {  
    window.location.href="/blog/window.location.href";
    setTimeout("abc()",10000);
  }

  4)定时刷新:

      4.1、<script>setTimeout("location.href='url'",2000)</script> 说明:url是要刷新的页面URL地址 2000是等待时间=2秒

      4.2、刷新框架页 〈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>");
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: