我想知道facebook.com這樣的頁面是如何工作的。當我看着firefox中的firebug輸出到xhttprequests
時,有很多關閉連接,但也有很多打開的連接。必須有更好的方法,然後每秒詢問服務器「是否有任何新消息」,但以其他方式,http頭包含長度以字節爲單位的html主體和瀏覽器下載內容的長度,因此請求無法以這種方式工作。Javascript opened connections
0
A
回答
1
看一看這個Comet
,你可以在這裏找到一些例子, How do I implement basic "Long Polling"?
或新的方式來做事 Websockets (and now with flash fallback)
0
您可以創建在線 - ajax連接,您不需要創建新的和新的連接
相關問題
- 1. Closing opened toggle div
- 2. IBM Connections
- 3. IBM Connections createGCD
- 4. GDataDB:Concurrent connections&Google Docs
- 5. python Redis Connections
- 6. IBM Connections活動
- 7. Oracle Connections和VS2012
- 8. '10.52.244.189'((1040,u'Too many connections'))「)
- 9. mysql和PDO simultanious connections
- 10. Ruby,Sinatra和Closing Connections
- 11. Nearby Connections API加密
- 12. Undertow on Spring leaks connections
- 13. Heroku Rails ClearDB Resque Connections
- 14. jQuery Hide \ show closes once opened a new one
- 15. Lotus Connections 3 SPI文檔對IBM Connections 4仍然有效嗎?
- 16. Fan-Gate,Like-Gate,show-to-connections,使用javascript和like box?
- 17. 在IBM Connections上調試JavaScript的最佳方式是什麼?
- 18. ViewController類中的Clear Connections/Outlets?
- 19. IRCD-hybrid Connections Limited在4026
- 20. LinkedIn get connections'電子郵件
- 21. IBM Connections 4.5 CR3更新
- 22. nodejs express windows max connections設置
- 23. 列出Apache Derby Active Connections
- 24. IBM Connections博客推薦API
- 25. 從Connections API- https://api.linkedin.com/v1/people/id=12345/connections接收到意外結果?
- 26. jQuery記憶遊戲:if $('。opened')。length; ==數字運行功能。
- 27. 爲什麼WinRT XAML BottomAppBar似乎沒有「Opened」事件?
- 28. 請確保<a href="local file"> is opened outside of browser
- 29. rev和haveRev與`p4 opened`有什麼區別?
- 30. 直接轉到Connections Inspector的方法
[服務器發送的事件](http://en.wikipedi a.org/wiki/Server-sent_events)? –