Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是从带有 PHP 标记的问题中截取的屏幕截图。
所以,如果我打开这个页面并让它在几分钟内不刷新,它就会出现
x questions with new activity
当我单击它时,它会显示所有最新更新。我想为新闻更新编写类似的脚本。是否使用 JavaScriptsetTimeout轮询服务器并将更新嵌入到<div>?
setTimeout
<div>
网络套接字
StackExchange.realtime.init('ws://sockets.ny.stackexchange.com:80');
http://socket.io/