早睡早起,方能养生
Sleep early rise early, way to keep healthy

浏览器控制台,用javascript设置页面自动刷新

super
2021-06-30 08:58
views 7402

var time = prompt('设置刷新时间/秒');
var href = window.location.href;
if (time > 0) {
    setTimeout(reload, 1000 * time);
    function reload () {
    	setTimeout(reload, 1000 * time);
    	var fram = '<frameset col="*"><frame src="'+ href  +'" /></frameset>';
    	with(document) {
        	write(fram);
        	void(close());
    	}
	}
}

 

打开F12控制台,在Console下,粘贴以上代码即可

 

 

粘贴完毕,点击回车键运行

 

 

提示输入定时刷新秒数,点击确定即可自动刷新页面



分享
0 条讨论
top