  //连接发生错误的回调方法
        websocket.onerror = function () {
            console.log("websocket.error");
        };

        //连接成功建立的回调方法
        websocket.onopen = function (event) {
            console.log("onopen");
            var param = {
                id: $("#UserID").val(),
                name: $("#UserName").val(),
                act: "produceNewUser",
                msg: ""
            }
            websocket.send(JSON.stringify(param));
        }

  