// Connected, send data
socket.send("Connected"); alert("Connected.");
};
socket.onmessage = function (e) {
var received_msg = e.data;
alert("Message received.");
};
socket.onclose = function () {
// WebSocket closed
alert("Connection closed.");
};
}
else {
// Browser doesn't support WebSockets
alert("Your browser does not support WebSockets.");
}
}
lu
(lu)
#1