我收到此错误:
DOM Invalidate exception 11
从下面的代码,但我找不到原因。
/*This is little bit pseudo stylish coded so might have some
syntax errors */
var socket;
var client = {
connect: function(){
socket = new WebSocket(mylocation);
socket.onopen = this.open;
socket.send = this.send;
},
open: function(){
this.send("Sent from socket open function"); //works
socket.send("Sent from socket open function"); //works
},
_send: function(){
socket.send("Sent from send function"); //error
this.send("Sent from send function"); //error
}
}
client.connect();
client._send();
----- ERROR DESCRIPTION --------
//DOMException {message: "InvalidStateError: DOM Exception 11",
//name: "InvalidStateError", code: 11
我目前正在为服务器使用 Java Jetty Websocket。这个错误是什么意思?