1
Uncaught Invalidstateerror: Failed to execute 'send' on 'Websocket': Still in CONNECTING state. (index):29 (Anonymous Function)
Code:
function smConnect() {
ws = new WebSocket('ws://127.0.0.1:1805/');
delete ws.URL;
ws.onopen = function(response) {
};
ws.onmessage = function(response) {
};
ws.onclose = function(response) {
};
ws.onerror = function(error) {
};
}
smConnect();
ws.send('message', 'hi');
What can it be?
The timer method smells of gambiarra, I prefer the
onopen
.– bfavaretto