modifié: superTornado.py

nouveau fichier: test.html
This commit is contained in:
sidya82
2014-02-27 21:22:02 +01:00
parent 00e95a2a98
commit 62bc232719
2 changed files with 51 additions and 1 deletions

30
test.html Normal file
View File

@ -0,0 +1,30 @@
<html>
<head>
<script>
function fun(){
alert("in fun()");
var val=document.getElementById("txt");
var ws = new WebSocket("ws://localhost:8888");
ws.onopen = function(evt) { alert("Connection open ...");
ws.send(val.value); };
ws.onmessage = function(evt) {
alert("from server: "+evt.data);
}
ws.onclose = function(evt) {
alert("Connection closed.");
}
}
</script>
</head>
<body bgcolor="#FFFFFF">
<input type="text" id="txt" />
<button onClick="fun()">click</button>
</body>
</html>