文件名称:sockjs.js websocket api
文件大小:125KB
文件格式:JS
更新时间:2020-12-09 05:35:16
sockjs.js websocket api
sockjs.js websocket api 亲测可用 if(this.websocket==null) { // 首先判断是否 支持 WebSocket if ('WebSocket' in window) { this.websocket = new WebSocket( "ws://"+this.vbshopURL+"/layim/server?id="+id); } else if ('MozWebSocket' in window) { this.websocket = new MozWebSocket( "ws://"+this.vbshopURL+"/layim/server?id="+id); } else { this.websocket = new SockJS( "http://"+this.vbshopURL+"/sockjs/layim/server?id="+id); } }