NodeKO WIN: iPad 2s.
If you are building HTML5 Web Apps, start by copying and pasting the code snippet below. If not, skip to Step 2.
<div pub-key="demo" sub-key="demo" id="pubnub"></div>
<script src="http://cdn.pubnub.com/pubnub-3.1.min.js"></script>
<script>(function(){
// Listen For Events
PUBNUB.subscribe({
channel : "hello_world", // Channel
error : function() { // Lost Connection (auto reconnects)
alert("Connection Lost. Will auto-reconnect when Online.")
},
callback : function(message) { // Received An Event.
alert(message.anything)
},
connect : function() { // Connection Established.
// Send Message
PUBNUB.publish({
channel : "hello_world",
message : { anything : "Hi from PubNub." }
})
}
})
})();</script>