my current code
[CODE]function send(){
var txt,msg,address;
txt = $(“msg”);
address = txt.value
msg = ({“op”:”addr_sub”, “addr”:”address”});
if(!msg){ alert(“Message can not be empty”); return; }
txt.value=””;
txt.focus();
try{ socket.send(msg); log(‘Sent: ‘+msg); } catch(ex){ log(ex); }
}
I took a script I found and simply added the var address. I set the address equal to what the msg used to be. The input of the form. I then set the msg to what I want the form to send to the websocket.
returns the error
[QUOTE]
[Exception… “Component returned failure code: 0x80460001 (NS_ERROR_CANNOT_CONVERT_DATA)” nsresult: “0x80460001 (NS_ERROR_CANNOT_CONVERT_DATA)” location: “JS frame :: XXXXXXXXXX.org/POS/POS.php :: send :: line 39” data: no]
line 39 in the line
[CODE]try{ socket.send(msg); log(‘Sent: ‘+msg); } catch(ex){ log(ex);
I know the original websocket works,
I am trying to make it simpler to send a command to a websocket. On the default code you can copy and paste {“op”:”addr_sub”, “addr”:”$bitcoin_address”} replace the address and hit send. Im trying to make so you just need to enter in the address and hit send.
the code originally looked like this.
[CODE]function send(){
var txt,msg;
txt = $(“msg”);
msg = txt.value;
if(!msg){ alert(“Message can not be empty”); return; }
txt.value=””;
txt.focus();
try{ socket.send(msg); log(‘Sent: ‘+msg); } catch(ex){ log(ex); }
}
Might be an issue with the quotes? I know javascript is funky about that. or maybe i’m missing something bigger? thanks