AJAX is still a polling technology

323 Views Asked by At

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?

3

There are 3 best solutions below

0
On

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.

2
On

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
(source: javalobby.org)

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.

0
On

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.