Skip to content

Instantly share code, notes, and snippets.

@glennblock
Created November 6, 2011 09:18
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 glennblock/1342633 to your computer and use it in GitHub Desktop.
Save glennblock/1342633 to your computer and use it in GitHub Desktop.
DNode client
<html>
<head>
<script src="/dnode.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload = function () {
var client = {};
client.sayAnotherMessage = function(message) {
document.getElementById('message').innerHTML += " and " + message;
};
DNode(client).connect(function (server) {
server.sayHello(function (message) {
document.getElementById('message').innerHTML = message;
});
});
};
</script>
</head>
<body>
Server says <span id="message">?</span>.
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment