保持清醒,不断思考。

Mike lucis


  • 首页
  • 归档
  • 分类
  • 标签
  • 关于
  • 联系
  •     

© 2023 Mike lucis

Theme Typography by Makito

Proudly published with Hexo

备案号: 湘ICP备2021005917号-1

友情链接: Lonely's Bolg

ღゝ◡╹)ノ♡

JS自动刷新脚本

发布于 2020-07-04 有趣小玩意  Javascript 

¶ JavaScript 自动刷新

代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
timeout=prompt("Set timeout (Second):");
count=0
current=location.href;
if(timeout>0)
setTimeout('reload()',1000*timeout);
else
location.replace(current);
function reload(){
setTimeout('reload()',1000*timeout);
count++;
console.log('每('+timeout+')秒自动刷新,刷新次数:'+count);
fr4me='<frameset cols=\'*\'>\n<frame src=\''+current+'\'/>';
fr4me+='</frameset>';
with(document){write(fr4me);void(close())};
}

使用方法:

  • 打开浏览器,按 F12 键
  • 找到 Sources 栏
  • 在子菜单中找到 Snippets 一项
  • + New snippets
  • 给脚本起一个名字,例如 自动刷新
  • 将代码粘贴至旁边的编辑栏中
  • 打开你要刷新的页面
  • 在保存的脚本上右键 → Run
  • 输入每次刷新的间隔时间
  • 确认
  • 开始等待吧

分享到 

 上一篇: libpng12.so.0 没有那个文件或目录 下一篇: WSL中文本地化 

© 2023 Mike lucis

Theme Typography by Makito

Proudly published with Hexo

备案号: 湘ICP备2021005917号-1

友情链接: Lonely's Bolg

ღゝ◡╹)ノ♡