How does one do realtime updates of a web page?

后端 未结 7 1838
囚心锁ツ
囚心锁ツ 2021-01-03 04:49

Google\'s GMail service does it because it integrates Google Talk -- and Etherpad (now typewith.me) made famous the system which is used by, for example, Google Wave. All su

相关标签:
7条回答
  • 2021-01-03 05:17

    You can use Comet.

    0 讨论(0)
  • 2021-01-03 05:22

    There are many options but basically i'd recommend you look into XMPP. i don't think i'm good enough to boil it down correctly, so i'll let a wiki talk for me

    In fact, google voice and video uses it for these systems.


    About AJAX, i think it's a communication channel, not a platform or a protocol for multiple person exchange. You could also answer "Use xml over http!" and still be at the same point :)

    0 讨论(0)
  • 2021-01-03 05:24

    AFAIK, they use some form of AJAX. However, I would recommend you use the AJAX libraries via jQuery. AJAX is simplified a lot if you use jQuery to do it.

    0 讨论(0)
  • 2021-01-03 05:25

    Asynchronous JavaScript and XML or AJAX

    With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. The use of Ajax techniques has led to an increase in interactive or dynamic interfaces on web pages. Data is usually retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not actually required, nor do the requests need to be asynchronous.

    0 讨论(0)
  • 2021-01-03 05:30

    I suggest using AJAX & jQuery for Asynchronous JS

    http://api.jquery.com/category/ajax/

    0 讨论(0)
  • 2021-01-03 05:37

    Javascript / Ajax allows you to send code to be executed on the client-side (that means, by the browser). Now if you e.g. define a loop which checks for new messages on server every 5 seconds, you can update the web-page "in-real-time" (plus the time for the server to process the req and send response), or similar. A practical example would be the RoR Prototype periodically_call_remote Ajax helper.

    Hope this helps!

    0 讨论(0)
提交回复
热议问题