jEdit › BestPractices › MoniWikiPo › UploadedFiles › guava › WebSocket-Html5
html5 >
<!DOCTYPE html> <html> <head> <script> if ("WebSocket" in window) { var ws = new WebSocket("ws://localhost:9123/"); ws.onopen = function() { ws.send("message to send"); }; ws.onmessage = function (evt) { alert(evt.data); }; ws.onclose = function() { alert("closed"); }; } else { alert("the browser doesn't support WebSocket."); } </script> </head> <body> hello </body> </html>