Created
September 24, 2016 10:36
-
-
Save arangates/9541b09ce1c2eff7eaa08c49848751b7 to your computer and use it in GitHub Desktop.
pubnubsubscribredata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>sub</title> | |
<div id="subdat" ></div> | |
<script src="http://cdn.pubnub.com/pubnub-3.16.3.min.js"></script><script type="text/javascript"> | |
var pubnub = PUBNUB({ | |
subscribe_key: 'sub-c-598e4d8e-e9e4-11e4-91d3-0619f8945a4f', // always required | |
publish_key: 'pub-c-3588af66-9bbd-4984-b578-27f5877f17db' // only required if publishing | |
}); | |
pubnub.subscribe({ | |
channel : 'Kcteee', | |
message : function(m){ | |
console.log(m) | |
document.getElementById("subdat").innerHTML=JSON.stringify(m); | |
}, | |
error : function (error) { | |
// Handle error here | |
console.log(JSON.stringify(error)); | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment