如何更新实时网站?
我用新链接更新了我的网站。该网站已上线。
如何让公众看到更新?我可以让页面自动更新吗?现在,除非他们刷新网页,否则他们不会知道更新。
I updated my website with new links. The website is live.
How do I get the public to see the updates? Can I make the pages update themselves automatically. Right now, unless they refresh the webpage, they won't know the updates.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以做的最简单的事情就是在页面标题中设置元刷新,这会建议客户端浏览器在固定间隔后重新加载页面:
这将使页面在 100 秒后重新加载。您还可以使用 Javascript、AJAX 轮询等执行各种其他技巧...但这基本上是普遍支持的。
The simplest thing you can do is set a meta refresh in your page's header, which would suggest to the client browsers to reload your page after a fixed interval:
which would make the page reload after 100 seconds. There's various other tricks you could do with Javascript, AJAX polling, etc... But this is basically universally supported.
他们必须重新加载网页才能显示任何更新的内容。如果这是您经常做的事情,并且您的访问者没有以足够高的频率重新加载您的页面,您可能需要使用 元刷新 或使用 AJAX 定期重新加载内容,请参阅 这个快速教程
they will have to reload the web page for any updated content to show. If thi is somethig you do very often, and your visitors do not reload your page at a high enough frequency, you may want to look at either using META REFRESH or using AJAX to reload the content on a regular timed basis see this quick tutorial