var username test var roomname test var socket new WebSoc
var username = \"test\";
var roomname = \"test\";
var socket = new WebSocket(\'ws://.onion/ws/chat/?username=\'+username+\' &room=\'+roomname+\'\');
socket.onmessage = function(msg) { var data = JSON.parse(msg.data); if(typeof data.chat === \"string\") { socket.send(\'c: \'); } }
I am trying to retrieve messages from a chat forum, which i removed that link to from the code, however it will only pick up the first three letters of chat. Is this a parsing issue? or how I am storing it with a string?
It will randomly only pick up 3 letters, like in the word awesome it might pickup AWE or SOM with no ryme or reason as to why.
Solution
There might be parsing issue , we are not sure about this now.
We need the application in which we can debug at our end and can tell you the proper answer without this we can not say anthing.
