File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ < div id =pubnub > </ div >
3+ < script src ="../pubnub.js "> </ script >
4+ < script > ( function ( ) {
5+ // INIT PubNub
6+ console . log ( PUBNUB ) ;
7+ var pubnub = PUBNUB . init ( {
8+ //leave_on_unload : true, // Perform a Leave Explicitly on Page Unload Event
9+ publish_key : 'demo' ,
10+ subscribe_key : 'demo'
11+ } ) ;
12+
13+ pubnub . channel_group_add_channel ( { "channel_group" :"xxx" , "channel" :"a" , "callback" :function ( r ) { console . log ( 'ERROR : ' + JSON . stringify ( r ) ) ; } } ) ;
14+
15+
16+ function cb ( m , e , c , d , f ) {
17+ console . log ( JSON . stringify ( m ) ) ;
18+ }
19+ pubnub . subscribe ( {
20+ callback : cb ,
21+ error : function ( r ) { console . log ( 'ERROR : ' + JSON . stringify ( r ) ) ; } ,
22+ channel_group : "xxx" ,
23+ connect : function ( r ) { console . log ( "CONNECT" ) ; } ,
24+ disconnect : function ( r ) { console . log ( "DISCONNECT" ) ; } ,
25+ reconnect : function ( r ) { console . log ( "RECONNECT" ) ; }
26+ } )
27+
28+
29+ } ) ( ) ; </ script >
You can’t perform that action at this time.
0 commit comments