Detailed description of JavaScript data push Comet technology _ javascript skills

Source: Internet
Author: User
This article mainly introduces the JavaScript data push Comet technology in detail. If you are interested, you can refer to the JavaScript data PUSH Service mainly for online webapp push, we don't need to take the initiative to push data from the Server to the local place every time we send Ajax requests like the Server.

History of Data push:

1. the HTTP protocol is simple round-robin, keeping a link unavailable, or sending requests to the backend through the front-end without stopping

2. After H5 is updated, WebSocket greatly improves the convenience of bidirectional and unidirectional data push.

3. SSE (Server-Send Event): a new way for the Server to push data

Comet: server push technology based on HTTP persistent connection
This lesson introduces Comet: server push technology based on HTTP persistent connection. Comet is a Web application architecture. The server actively pushes data (an endless loop of Ajax requests) to the client program asynchronously without explicitly sending requests from the client. The Comet architecture is very suitable for event-driven Web applications and applications that require strong interactivity and real-time performance, such as stock exchange analysis, chat rooms, and online Web games.

1. Let's take a look at the simplest example of ajax request json data:

Index.html

 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.