JSON.parse problem in construct2-r103.2-setup_3404

Get help using Construct 2

Post » Sat Oct 20, 2012 8:08 am

"Javascript error!
SyntaxError: JSON.parse: unexpected character
http://localhost:50000/My_plugin.js, line 134"
-------------------------------------------------
I develop my Own plugin to connect my Gamer to server via webSocket. Everything working very smooth and stable in r95. But runtime err appear after I upgrade to r103.2.3404349. I did try the test but could not define problem. For example: If I write only JSON testing with bellow JavaScript code, it is working ok:

var _data = '{"firstName":"John" , "lastName":"Doe"}';
var obj = JSON.parse(_data);                     
alert(obj.firstName);


Once connect to my webSocket server, bellow message popup:
"Javascript error!
SyntaxError: JSON.parse: unexpected character http://localhost:50000/My_plugin.js, line 134"


But actually with R95 - this problem never happen.
My server using windown2003 and websocket server base on Fleck at:
https://github.com/statianzo/Fleck

Please help me..I don't wanna stay slickly in R95 forever...:(.

Best regard..

PS: the declaration of websocket in my own plug in like that


if(typeof(WebSocket) == "undefined" && typeof(MozWebSocket) == "undefined")
return;
var socket = this.socket;
wsImpl = window.WebSocket || window.MozWebSocket;
B
11
S
2
Posts: 73
Reputation: 1,438

Return to How do I....?

Who is online

Users browsing this forum: abdalghani and 23 guests