如何实时#1更新的作品? [英] How Stackoverflow Realtime Updates works?

查看:154
本文介绍了如何实时#1更新的作品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是从问题所采取的截图标记为PHP。

Here is the screenshot taken from questions tagged with PHP.

所以,如果我打开这个页面,让它无刷新了几分钟就appers

So, If I open this page and leave it without refresh for some minutes it appers

X的问题与新的活动

当我点击它,它显示所有最新的更新。我想写类似的脚本进行新闻更新。它使用JavaScript是的setTimeout 轮询服务器,并嵌入了更新,以< D​​IV>

And when I click it, It display all latest updates. I want to write similar script for news updates. Is it using JavaScript setTimeout to poll the server and embed the updates to <div>?

推荐答案

的WebSockets

websockets

StackExchange.realtime.init('ws://sockets.ny.stackexchange.com:80');

http://socket.io/

这篇关于如何实时#1更新的作品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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