Created
November 6, 2011 09:18
-
-
Save glennblock/1342633 to your computer and use it in GitHub Desktop.
DNode client
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
<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