Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'CL-225'
  • Loading branch information
geremy cohen committed Nov 1, 2012
2 parents 0594448 + e9d5a47 commit 0466f6a
Show file tree
Hide file tree
Showing 21 changed files with 1,276 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
59 changes: 59 additions & 0 deletions javascript-modern/3.3/README.md
@@ -0,0 +1,59 @@
# PubNub HTML5 Modern JavaScript Library

For a faster PubNub load, use the PubNub HTML5 Modern JavaScript
Library which is `CommonJS` and HTML5 `WebWorker` Ready.

#### Supported Browsers:

- firefox/3.6'
- firefox/9.0'
- firefox/10.0'
- chrome/16.0'
- chrome/17.0'
- iexplore/9.0'
- safari/5.1'

```html
<script src=pubnub-3.3.js></script>
<script>(function(){
// ----------------------------------
// INIT PUBNUB
// ----------------------------------
var pubnub = PUBNUB({
publish_key : 'PUBLISH_KEY_HERE',
subscribe_key : 'SUBSCRIBE_KEY_HERE',
ssl : false,
origin : 'pubsub.pubnub.com'
});
// ----------------------------------
// LISTEN FOR MESSAGES
// ----------------------------------
pubnub.subscribe({
restore : true,
connect : send_hello,
channel : 'my_channel',
callback : function(message) {
console.log(JSON.stringify(message));
},
disconnect : function() {
console.log("Connection Lost");
}
});
// ----------------------------------
// SEND MESSAGE
// ----------------------------------
function send_hello() {
pubnub.publish({
channel : 'my_channel',
message : { example : "Hello World!" },
callback : function(info) {
console.log(JSON.stringify(info));
}
});
}
})();</script>

```

0 comments on commit 0466f6a

Please sign in to comment.