views:

45

answers:

3

I am looking to add comet long polling functionality to my site by using ajax and jquery as I am not familiar with the javascript prototype framework. However, when I search for this, I always seem to end up with tutorial which use the prototype framework. Does anyone know of any comprehensive tutorial for comet long polling based on jquery and ajax?

A: 

Cometd has bindings for both the jQuery and Dojo JavaScript libraries. I don't know how comprehensive it is, but it has documentation here: http://cometd.org/documentation/cometd-javascript

Ash
+1  A: 

Here's a Comet tutorial using Jquery http://screenr.com/SNH
Code used in this tutorial

Ninja Dude
The loop which it constantly runs in that tutorial, is that not server heavy?
oshirowanen
A: 

Comet and Long polling imply writing part of your code in client side and part on server side. You would need in server CometD or Ape to been able to connect to a Comet server, i find that installing them are usually a pain in the ass.

The option that i have found way more easy is to have Node.js with a "comet" module. Faye(also available for ruby) is a long pole pub sub server quite usefull for chats and Socket Io is a great way to have a page updated constantly to sockets(websockets with flash fallback).

Faye Site:http://faye.jcoglan.com/ Socket Io:http://socket.io/

Siedrix