zoukankan      html  css  js  c++  java
  • javaScript刷新页面

    刷新页面有一下几种:

    1、直接在页面上: 每两秒刷新页面 

    <meta http-equiv="refresh" content="2">

    2、每秒刷新页面

    1 setTimeout('myrefresh()',1000);
    2 function myrefresh() {
    3 window.location.reload(); 
    4 } 

    3、每整点刷新一次

    1 setInterval("flash()",1000);
    2      function  flash(){
    3         var now=new Date();
    4         var s=now.getSeconds();
    5         var m=now.getMinutes();
    6         if(m=="0"&& s=="0"){
    7             window.location.reload();
    8         }
    9     };

    4、每两小时刷新一次页面

     1  setInterval("flash2Hour()", 1000);
     2     function flash2Hour(){
     3         var now=new Date();
     4         var h=now.getHours();
     5         var m=now.getMinutes();
     6         var s=now.getSeconds();
     7         var arr=["0","2","4","6","8","10","12","14","16","18","20","22"];
     8         for(var i=0;i<arr.length;i++){
     9             if(h==arr[i]){
    10                 if(m=='0'&& s=='0'){
    11                     window.location.reload();
    12                 }
    13             }
    14         } 
    15     }; 

     

  • 相关阅读:
    Bluedroid介绍
    Android蓝牙介绍
    Android Bluetooth抓包
    Bluetooth LMP介绍
    Bluetooth Baseband介绍
    Bluetooth SDP介绍
    Bluetooth HFP介绍
    Bluetooth RFCOMM介绍
    Bluetooth L2CAP介绍
    Windows开发
  • 原文地址:https://www.cnblogs.com/whx20100101/p/7681727.html
Copyright © 2011-2022 走看看