赞
踩
$(function(){ $.ajaxSettings.async=false; $.post('url地址/show/doSaveSession',{'hotelid':1},function(data){ console.log("执行保存session");//模拟先登录 }); $.ajaxSettings.async=true; // ws://localhost:7001/show 此为通信地址 ws = new WebSocket("ws://localhost:7001/show"); // WebSocket有以下3个方法: ws.onopen = function () { console.log("建立链接"); } ws.onclose = function () { console.log("onclose"); } ws.onmessage = function (msg) { console.log("----------------"); console.log(msg.data); } });
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。