此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。
Server-sent events
網頁一般來說是由客戶端向伺服器請求資料. 藉由 server-sent 事件, 伺服器在任何時候都可以向客戶端推送資料. 即將推送進來的訊息可以自客戶端上做 Events + data 處理.
文件
- 使用 server-sent events
- 
有關如何在伺服器端和客戶端使用 server-sent 事件的教學文章. 
- 參考 EventSource
- 
關於客戶端的 EventSource API. 
工具
- Remy Sharp's EventSource polyfill
- Yaffle's EventSource polyfill
- Rick Waldron's jquery plugin
相關主題
規範
| Specification | 
|---|
| HTML> # server-sent-events> | 
參見
- A Twitter like application powered by server-sent events and its code on Github.
- HTML5 and Server-sent events