自动刷新页面js脚本

var timeout = prompt("设置刷新时间间隔[S]");
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 @ 2022-07-07 18:04  clgGlobal  阅读(588)  评论(0编辑  收藏  举报