- UID
- 245815
- 帖子
- 3
- 精华
- 0
- 贡献
- 0
- 推广
- 0
- 有效BUG
- 0
- 注册时间
- 2009-11-11
|
本帖最后由 5653131 于 2009-11-11 02:06 编辑
就是在当前页面执行这个代码(比如 javascript:choose('1');)
效果如同在地址栏输入这段代码然后回车,有点像小孩子玩的qq空间那种代码的使用方法
实际上我是玩一些webgame,手动点太累了,为了偷懒……
看到有个能定时刷新的插件,但代码看起来一头雾水,各位能否帮帮忙修改下,谢谢
-
- <script language="JavaScript">
- var security_id=%max_security_id;
- var intv = prompt('What is the time to Reload (in seconds):','60');
- if(intv&&!isNaN(intv)){
- var folder=external.m2_plugin_folder(security_id, "Continuous Reload");
- var reload_button=folder+'\rreload_button.gif';
- var close_button=folder+'\close_button.gif';
- var ft='<html>\n';
- ft+='<head><title>\n';
- ft+=external.get_tab(security_id, external.cur_sel).document.title+'\n';
- ft+='</title></head>\n';
- ft+='<frameset rows=\'*,15\' framespacing=0 border=0 frameborder=no>\n';
- ft+='<frame id=\'TargetFrame\' scrolling=auto noresize frameborder=no>\n';
- ft+='<frame id=\'TimerFrame\' scrolling=no noresize frameborder=no>\n';
- ft+='</frameset>\n';
- ft+='</html>';
- with(document){
- write(ft);
- frames['TargetFrame'].location.href=document.location.href;
- var docstr='<html>\n';
- docstr+='<body style=\'background-color: black; color: white; font-family: Verdana, Arial, Helvetica; font-size: 11px; font-weight: normal; margin-top:0px;\'>\n';
- docstr+='<div align=\'center\' valign=\'middle\'><a href=\"javascript:reloadFrame()\" onmouseover=\"window.status=\'Reload the Page\'; return true\"><img align=\'middle\' alt=\'Reload the Page\' src=\''+reload_button+'\' height=\'11\' width=\'43\' border=\'0\'></a> Reloading in <span valign=\'middle\' id=\'caption\'></span> <a href=\"javascript:document.location=parent.frames[\'TargetFrame\'].location.href;\" target=\"_parent\" onmouseover=\"window.status=\'Close Continuous Reload\'; return true\"><img align=\'middle\' alt=\'Close Continuous Reload\' src=\''+close_button+'\' height=\'11\' width=\'11\' border=\'0\'></a> </div>\n';
- docstr+='</body>\n';
- docstr+='<script>\nvar reloadIntv='+intv+';\nvar secsLeft='+intv+';\nfunction reloadFrame(){secsLeft=reloadIntv+1;parent.frames[\'TargetFrame\'].history.go();}\nfunction countDown(){secsLeft--;showTime();}\nfunction showTime(){\ntemp = secsLeft;\ntemp2 = temp / (60*60);\nhours = Math.floor(temp2);\ntemp = temp - (hours*60*60);\ntemp2 = temp / 60;\nminutes = Math.floor(temp2);\ntemp = temp - (minutes*60);\nseconds = temp;\nif(hours < 10) hours = "0"+hours;\nif(minutes < 10) minutes = "0"+minutes;\nif(seconds < 10) seconds = "0"+seconds;\ndocument.getElementById(\'caption\').innerHTML=hours+\':\'+minutes+\':\'+seconds;\n}\nsetInterval(\'reloadFrame()\','+intv*1000+');\nsetInterval(\'countDown()\',1000);\nshowTime();\n</script/>\n';
- docstr+='</html>';
- frames['TimerFrame'].document.write(docstr);
- }
- }
-
- </script>
-
复制代码 |
|