zoukankan      html  css  js  c++  java
  • JS_0003:js刷新页面 关闭页面

    页面自动刷新js版

    <script language="JavaScript">
    function myrefresh()
    {
           window.location.reload();
    }
    setTimeout('myrefresh()',1000); //指定1秒刷新一次
    </script>
    如果想关闭窗口时刷新或者想开窗时刷新的话,在<body>中调用以下语句即可。
    
    <body οnlοad="opener.location.reload()"> 开窗时刷新
    <body onUnload="opener.location.reload()"> 关闭时刷新
    
    <script language="javascript">
    window.opener.document.location.reload()
    </script>
    1.页面自动刷新:把如下代码加入<head>区域中
    <meta http-equiv="refresh" content="20">
    其中20指每隔20秒刷新一次页面.
    
    2.页面自动跳转:把如下代码加入<head>区域中
    <meta http-equiv="refresh" content="20;url=//www.jb51.net">
    其中20指隔20秒后跳转到//www.jb51.net页面
    琥珀君的博客
  • 相关阅读:
    Ethical Hacking
    Ethical Hacking
    Ethical Hacking
    Ethical Hacking
    Ethical Hacking
    Ethical Hacking
    Ethical Hacking
    Can you answer these queries? HDU
    Count the Colors ZOJ
    Balanced Lineup POJ
  • 原文地址:https://www.cnblogs.com/eliteboy/p/12878501.html
Copyright © 2011-2022 走看看