timeout=prompt("時間秒:");
count=0
current=location.href; // 獲取當前的URL
if(timeout>0)
setTimeout('reload()',1000*timeout);
else
location.replace(current); // 時間間隔不大於0,僅刷新一次
function reload(){
setTimeout('reload()',1000*timeout); // timeout秒後執行reload函數,實現無限循環刷新
count++;
console.log('每('+timeout+')秒自動刷新,刷新次數:'+count);
fr4me='<frameset cols=\'*\'>\n<frame src=\''+current+'\'/>';
fr4me+='</frameset>';
with(document)
{
write(fr4me);
void(close())
};
}
Ctrl + enter 運行 然後輸入多少秒1500約等於25分鐘