added js file

This commit is contained in:
maxwell 2010-06-20 22:11:37 -07:00
parent 8019fc8d31
commit 7bc165d7a0

View file

@ -0,0 +1,12 @@
$(document).ready(function(){
function debug(str){ $("#debug").append("<p>" + str); };
ws = new WebSocket("ws://localhost:8080/");
ws.onmessage = function(evt) { $(".msg").prepend("<p>"+evt.data+"</p>"); };
ws.onclose = function() { debug("socket closed"); };
ws.onopen = function() {
debug("connected...");
ws.send("hello server");
ws.send("hello again");
};
});