Tutorial :AJAX is still a polling technology


I have read up on AJAX and pushing technologies. Is AJAX still a pulling technology that still requires Push Technology such as Java Pushlets and Tomcat Comet?

In another words is it correct to say, that Data is being push from server to client. then client pulls that data using AJAX to place it on web browser?


Yes ajax queries data from a webserver like tomcat or others but there is a difference in polling data from the server between an ajax request and a normal request

Here is an image which may make this clear to you: alt text http://www.javalobby.org/articles/ajax/ajax-fig2_small.png

so as you can see in the above image it only polls the required data between requests and doesn't query the whole page from the server.


In AJAX, it's always the browsers that initiates the action/contact with the server, yes. To the best of my knowledge, there is no way to push data after the page has completed loading.


Technically speaking, you can use AJAX long polling or XHR streaming to achieve push-based messaging. These techniques both keep a connection to the server alive and allow for event-based messaging.

It is also worth noting that with appropriate server software, you can support WebSockets (a feature of HTML5), which are supported by the next version of the major browsers. <eventsource> is also out there, though it is only supported by Opera (booooo). Both of these technologies allow for seamless push messaging.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »