<html> <head> <title>hello world</title> </head> <body> <script language="JavaScript"> function myrefresh() { window.location.reload(); } setTimeout(''myrefresh()'',8000); </script> <div id="testloadimg"> </div> <script type="text/javascript"> var arr = ["https://www.asphp.net/"]; function timedCount() { var content = ""; for (var i = 0; i < arr.length; i++) { content += "<img src=\""+arr[i]+"?r=" + Math.random() + "\" />"; } document.getElementById("testloadimg").innerHTML = content; setTimeout("timedCount()", 20000); } timedCount(); </script> </body>
利用JavaScript达到无限刷新某些网站页面的目的,在arr里面添加所需要刷新的网站,默认时间单位为秒。
展开全文