I need to make a section of my site like a vidiprinter stlye thing where I can update it and the page will refresh automatically on the user's device without them having to refresh. Ideally if I could allow other people who I specify to update the thread as well that would be great but is not essential. Is there any way that I can do this? (As simple as possible)
我需要让我的网站的一部分像一个vidiprinter stlye的东西,我可以更新它,页面将在用户的设备上自动刷新,而无需刷新。理想情况下,如果我可以允许我指定的其他人更新线程,那将是很好但不是必需的。有什么方法可以做到这一点吗? (尽可能简单)
Thanks!
1 个解决方案
#1
0
Have javascript check / make an ajax call to some back end page to check for updated. I'd also save the time stamp of the last time the page was updated, and then check if the newest comment / update time stamp is greater than the old time stamp, then update the page either by refreshing the whole page, or by adding the info right there from an an ajax call.
让javascript检查/对某个后端页面进行ajax调用以检查更新。我还会保存上次更新页面的时间戳,然后检查最新的评论/更新时间戳是否大于旧时间戳,然后通过刷新整个页面或添加页面来更新页面来自ajax电话的信息。
#1
0
Have javascript check / make an ajax call to some back end page to check for updated. I'd also save the time stamp of the last time the page was updated, and then check if the newest comment / update time stamp is greater than the old time stamp, then update the page either by refreshing the whole page, or by adding the info right there from an an ajax call.
让javascript检查/对某个后端页面进行ajax调用以检查更新。我还会保存上次更新页面的时间戳,然后检查最新的评论/更新时间戳是否大于旧时间戳,然后通过刷新整个页面或添加页面来更新页面来自ajax电话的信息。