matoung

 1//JavaScripts to refresh every 30 seconds
 2var sMsg;
 3var limit="0:30"//min:sec
 4var parselimit=limit.split(":");
 5parselimit=parselimit[0]*60+parselimit[1]*1;
 6
 7function beginrefresh()
 8{
 9    if (parselimit==1)
10    {
11        window.location.reload();
12    }

13    else
14    
15        parselimit-=1;
16        curmin=Math.floor(parselimit/60);
17        cursec=parselimit%60;
18        if (curmin!=0)
19        {
20            sMsg="This page will refresh in " +curmin +" minutes and "+cursec +" seconds."
21        }

22        else
23        {
24            sMsg="This page will refresh in " +cursec +" seconds."
25        }

26        window.status=sMsg;
27        setTimeout("beginrefresh()",1000);
28    }

29}

30        </script>

分类:

技术点:

相关文章:

  • 2021-10-29
  • 2021-11-19
  • 2021-12-05
  • 2021-12-05
  • 2021-11-13
  • 2021-11-19
  • 2021-09-30
猜你喜欢
  • 2021-12-13
  • 2021-11-19
  • 2021-11-19
  • 2021-12-15
  • 2021-11-19
  • 2021-11-19
  • 2021-06-19
相关资源
相似解决方案