HTML5 APPLICATIONS DEVELOPMENT MANUAL

(lu) #1

// 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.");
}
}








A second alert box should appear, stating that the connection is

Free download pdf