Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sub.html
<html>
<head>
<title>Notifications</title>
</head>
<body>
<center><h2>Notifications</h2></center>
<div id="notification"></div>
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load jQuery
google.load("jquery", "1.6");
</script>
<script src='http://pubsub.io/pubsub.io.js'></script>
<script>
var pubsub = pubsubio.connect('localhost:9999');
//assina o hub e filtra para buscar somente as mensagens de nome=events para o user=eminetto
pubsub.subscribe({name: 'events', user: 'eminetto'}, function(doc) {
$('#notification').prepend('<a href="' + doc.detail + '">' + doc.title + '</a><br>');
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.