jQuery Push API

June 17th, 2010 The new PubNub JavaScript Push API 2.0 now with jQuery Plugin! If you are a jQuery user and have wanted a Push API with Publish and Subscribe, then hurray! Here is the fastest and lightest jQuery Push API. It is compatible with mobile phone devices such as iPhone, iPad, Blackberry, Android, Symbian and more.

jQuery with PubNub JavaScript Push API 2.0

jQuery Push API provides Comet based Publish and Subscribe real time messaging. It offers the functions available to the PubNub JavaScript Push API. The following are the two most common functions:

jQuery Comet Subscribe

// jQuery.PUBNUB.subscribe( args, callback )
jQuery.PUBNUB.subscribe({
    channel : 'my_channel'
}, function(message) {
    // Show Message
    console.log(message);
} );

jQuery Comet Publish

// jQuery.PUBNUB.publish( args, callback )
jQuery.PUBNUB.publish( {
    channel : 'my_channel',
    message : { 'my_var' : 'some text data' }
});

Download JavaScript Push API

When using PubNub with jQuery, place jQuery script before PubNub. This way you will earn the jQuery.PUBNUB object namespace. Read Updated API 2.0 Doc for full list of functions: JavaScript Push API 2.0 Tutorial Updates

Visit jQuery website for additional details: jQuery Push API