Sha256: 566d44fee4f19339048d722caad548f049f3030b738cbe9f838a3018baebd2be
Contents?: true
Size: 1.6 KB
Versions: 1
Compression:
Stored size: 1.6 KB
Contents
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <meta content="text/css" http-equiv="content-style-type" /> <meta content="text/javascript" http-equiv="content-script-type" /> <script type="text/javascript" src='js/jquery.min.js'></script> <script type="text/javascript" src='js/swfobject.js'></script> <script type="text/javascript" src='js/FABridge.js'></script> <script type="text/javascript" src='js/web_socket.js'></script> <script type="text/javascript" src='js/json2.js'></script> <link rel="stylesheet" type="text/css" href="echo.css" /> <title>Rev-WebSocket Demo: Echo server</title> <script> WS_URL = "ws://localhost:8081"; WEB_SOCKET_SWF_LOCATION = "js/WebSocketMain.swf"; var global = this; $(document).ready(function(){ function debug(message) { html = "<p><span class='time'>"+new Date()+"</span>"+message+"</p>" $("#debug").append(html); } debug("connecting to "+WS_URL+"..."); ws = new WebSocket(WS_URL); ws.onopen = function() { debug("connected."); text = "client: hello"; ws.send(text); debug("message sent: "+text); } ws.onclose = function() { debug("disconnected..."); } ws.onerror = function(msg) { debug("failed to connect:"+msg); } ws.onmessage = function(event) { debug("message received: "+event.data); $("#message").append("<p>"+event.data+"</p>"); } }); </script> </head> <body> <div> <form action="/push" target="_blank" method="post"> <input type="text" name="text" id="text" value="text..." /> <input type="submit" value="submit" /> </form> </div> <div id="message"></div> <div id="debug"></div> </body>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rev-websocket-0.1.3 | examples/views/rpc.erb |