The world of dynamic web applications offers various ways for a client and server to interact. Two approaches are particularly well suited for situations when information on the server changes frequently. These approaches are: HTTP Streaming, and Client Polling (JavaScript Polling).

In HTTP streaming, the client/server connection is left open for an extended period of time so that data is streamed from the server to the client. This approach is also known as server-side push, reverse Ajax, or comet. As information changes on the server, updates are pushed to the client.

With Client Polling, the browser periodically issues an XMLHttpRequest call to obtain new information from the server. For example, a client can send an XMLHttpRequest to the server every five seconds to get new information. This approach is also known as periodic refresh.

Look at this, Using a Javascript-Centric View Tier. Demo: here.

Or you want to try the reusable component, Poller – YUI3 Component

Reference:
JavaScript Timing Events

Advertisements