tweetcast/twisted/client/lib/websocket-js/sample.html
changeset 410 bf5cf5a9e737
parent 409 f7ceddf99d6d
parent 406 86b62b98fea7
child 411 0471e6eb8a1b
child 412 97c082990f8d
--- a/tweetcast/twisted/client/lib/websocket-js/sample.html	Wed Dec 07 19:28:46 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-<!--
-  Lincense: Public Domain
--->
-
-<html><head>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-  <title>Sample of web_socket.js</title>
-  
-  <!-- Include these three JS files: -->
-  <script type="text/javascript" src="swfobject.js"></script>
-  <script type="text/javascript" src="web_socket.js"></script>
-
-  <script type="text/javascript">
-    
-    // Set URL of your WebSocketMain.swf here:
-    WEB_SOCKET_SWF_LOCATION = "WebSocketMain.swf";
-    // Set this to dump debug message from Flash to console.log:
-    WEB_SOCKET_DEBUG = true;
-    
-    // Everything below is the same as using standard WebSocket.
-    
-    var ws;
-    
-    function init() {
-
-      // Connect to Web Socket.
-      // Change host/port here to your own Web Socket server.
-      ws = new WebSocket("ws://localhost:9000/");
-
-      // Set event handlers.
-      ws.onopen = function() {
-        output("onopen");
-      };
-      ws.onmessage = function(e) {
-        // e.data contains received string.
-        output("onmessage: " + e.data);
-      };
-      ws.onclose = function() {
-        output("onclose");
-      };
-      ws.onerror = function() {
-        output("onerror");
-      };
-
-    }
-    
-    function onSubmit() {
-      var input = document.getElementById("input");
-      // You can send message to the Web Socket using ws.send.
-      ws.send(input.value);
-      output("send: " + input.value);
-      input.value = "";
-      input.focus();
-    }
-    
-    function onCloseClick() {
-      ws.close();
-    }
-    
-    function output(str) {
-      var log = document.getElementById("log");
-      var escaped = str.replace(/&/, "&amp;").replace(/</, "&lt;").
-        replace(/>/, "&gt;").replace(/"/, "&quot;"); // "
-      log.innerHTML = escaped + "<br>" + log.innerHTML;
-    }
-
-  </script>
-</head><body onload="init();">
-  <form onsubmit="onSubmit(); return false;">
-    <input type="text" id="input">
-    <input type="submit" value="Send">
-    <button onclick="onCloseClick(); return false;">close</button>
-  </form>
-  <div id="log"></div>
-</body></html>