forked from pubnub/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple.html
More file actions
40 lines (32 loc) · 853 Bytes
/
Copy pathsimple.html
File metadata and controls
40 lines (32 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<div id=pubnub></div>
<script src="../pubnub.js"></script>
<script>
// INIT PubNub
//console.log(map);
var pubnub = PUBNUB.init({
'publish_key' : 'demo',
'subscribe_key' : 'demo'
});
pubnub.subscribe({
'channel' : "an",
'callback' : function(r) {
console.log(JSON.stringify(r));
},
'presence' : function(r) {
console.log(JSON.stringify(r));
},
'error' : function(r) {
console.log('ERROR');
console.log(JSON.stringify(r));
},
'disconnect' : function(r) {
console.log('DISCONNECT ' + JSON.stringify(r));
},
'reconnect' : function(r) {
console.log('RECONNECT ' +JSON.stringify(r));
},
'connect' : function(r) {
console.log('CONNECT ' +JSON.stringify(r));
}
})
</script>