实现网页自动刷新

var timeout = prompt("");
var current = location.href;
if(timeout>0){
    setTimeout('reload()',1000*timeout);
}else{
    location.replace(current);
}
function reload(){
  setTimeout('reload()',1000*timeout);
  var fr4me = '<frameset cols=\'*\'>\n<frame src=\' '+current+'\'/>';
  fr4me+='</frameset>';
  with(document){
     write(fr4me);
     void(close());
  };
}

posted @ 2023-09-27 09:01  QxrwQ  阅读(11)  评论(0编辑  收藏  举报