Skip to content

Instantly share code, notes, and snippets.

@mebjas
Last active November 25, 2015 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mebjas/ba54a91472f89b5d165b to your computer and use it in GitHub Desktop.
Save mebjas/ba54a91472f89b5d165b to your computer and use it in GitHub Desktop.
<script src="https://cdn.socket.io/socket.io-1.3.7.js"></script>
<script src="./client/socket.notification.js"></script>
<script>
var n = new notification({url: 'http://127.0.0.1:8090'});
n.bind({
channel: 'test',
message: function(data) {
if (typeof data.hello != 'undefined') return;
document.body.innerHTML += ' <div> New Message: ' +JSON.stringify(data.data) +'</div>';
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment