JCX
JCX

Reputation: 1449

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?

Upvotes: 1

Views: 322

Answers (3)

Pranay Rana
Pranay Rana

Reputation: 176956

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.

Upvotes: 1

mattbasta
mattbasta

Reputation: 13709

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.

Upvotes: 0

Norbert de Langen
Norbert de Langen

Reputation: 181

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.

Upvotes: 0

Related Questions