socketio部分为什么在native上和web上运行,server端解析json结果不一样

socketio部分为什么同样的代码同时在native上和web上运行,server端解析json结果不一样,我server端是用node.js写的,native运行server端的log能正常解析,而在浏览器上运行的在server端无法正常解析,显示undefined。
这个是json的定义:var strJSON = cc.formatStr("{“shopName”:"%s", “shopAddress”:"%s", “contactor”:"%s", “shopTel”:"%d"}]",
this._strShopName, this._strShopAddress, this._strContactor, parseInt(this._strShopTel));

问题解决了,在web平台发布时还要多一项工作,就是把json字符串解析成json对象,另外就是把上文中那个strJSON中共的中括号去掉,改完即为:
var strJSON = cc.formatStr("{“shopName”:"%s", “shopAddress”:"%s", “contactor”:"%s", “shopTel”:"%d"}",
this._strShopName, this._strShopAddress, this._strContactor, parseInt(this._strShopTel)); //this._strShopTel
var json = eval(’(’ + strJSON + ‘)’); 然后再发送就没有问题了 。。

楼主你好,想请教一下cocos2d-js的socket.io通信这一块的问题,可以加个qq吗,1136608189