简体   繁体   English

html:使用自动重载功能“包装”网页的任何方法?

[英]html: any way to “wrap” a web page with an auto-reload function?

I have a status page that I would like to periodically reload. 我有一个状态页面,我想定期重新加载。 Instead of coding a refresh action into the page itself, I would like to have a wrapper page handle the periodic reloading. 与其将刷新操作编码到页面本身中,我不希望有一个包装器页面来处理定期重新加载。 Any such thing available off the shelf? 现成的东西有吗?

Something I could use like this would be perfect: 我可以这样使用的东西是完美的:

http://foo/automatic-page-reloader?interval=60&page=http://foo/mypage.html

If you don't want to delve into JavaScript or anything like that, you could simply use an IFRAME where the framed page has a META refresh tag. 如果您不想研究JavaScript或类似的东西,您可以简单地使用IFRAME,其中框架页面带有META刷新标签。 eg: 例如:

<meta http-equiv="refresh" content="60" />

You could make your wrapper page contain some javascript and a frame. 您可以使包装页面包含一些javascript和框架。

The javascript would execute a reload() call on the frame every once in a while using a setTimeOut() call. javascript将使用setTimeOut()调用每隔一段时间在框架上执行一次reload() setTimeOut()调用。

A sample solution to this problem can be seen here . 样本解决这个问题可以看出这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM