forked from pubnub/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisconnect.html
More file actions
31 lines (26 loc) · 710 Bytes
/
Copy pathdisconnect.html
File metadata and controls
31 lines (26 loc) · 710 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
<!doctype html>
<html>
<head>
<!-- Hey, let's be friends! twitter.com/pubnub -->
<title>PubNub JavaScript Unit Test</title>
<meta http-equiv=content-type content=text/html;charset=utf-8>
</head>
<body>
<script src=../pubnub.min.js></script>
<script>(function(){
var pubnub = PUBNUB.init({
publish_key : 'demo',
subscribe_key : 'demo'
});
pubnub.subscribe({
channel : 'will-disconnect,a-chan,b-chan',
message : function(){ log('MESSAGE') },
connect : function(){ log('CONNECT') },
reconnect : function(){ log('RECONNECT') },
disconnect : function(){ log('DISCONNECT') }
});
function log(m) { console.log(m) }
})();</script>
</div>
</body>
</html>