Skip to content

Instantly share code, notes, and snippets.

@johndemic
Created March 30, 2012 17:40
Show Gist options
  • Save johndemic/2253270 to your computer and use it in GitHub Desktop.
Save johndemic/2253270 to your computer and use it in GitHub Desktop.
<head>
<script type="text/javascript" src="mule-resource/js/mule.js"></script>
<script type="text/javascript">
function init()
{
mule.subscribe("/mule/notifications", notif);
}
function dispose()
{
mule.unsubscribe("/mule/notifications", notif);
}
function notif(message)
{
console.debug("data:" + message.data);
//... code to handle the received data
}
</script>
</head>
<body onload="init()" onunload="dispose()">
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment