如何安排IE页面重新加载 [英] How to schedule IE page reload

查看:102
本文介绍了如何安排IE页面重新加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是否可以使用一种机制来每隔'n'分钟强制重新加载页面?我无法修改页面代码本身,刷新请求应该从页面本身外部发出

Is there a mechanism i can use to force page reload every 'n' minutes? I can't modify the page code itself, "refresh" request should be issued from outside of the page itself

推荐答案

var timedRefresh = setTimeout(function(){location.reload(true)},1*60000)

这将每分钟刷新页面。如果你把它变成了关于greasemonkey的脚本,它将不断地注入页面并继续执行每分钟+加载时间。

That will refresh the page every minute. If you make it into a script for greasemonkey it will continually be injected into the page and keep executing every minute + load time.

另一种方法是按照建议放置iframe中的页面。例如

ANother way is to, as suggested, put the page in an iframe. e.g.

if (self == top){
document.body.innerHTML = '<iframe id="meh" src="' + location.href + '" width="100%" height="100%">';
var t = setInterval("document.getElementById('meh').src = location.href", 1000);
}

这只是在Chrome中测试过,而innerHTML可能会带来一些问题IE浏览器。 (不确定)

That has only been tested in Chrome however, and innerHTML may pose some problems with IE. (not sure though)

这篇关于如何安排IE页面重新加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆