jinyistudio Well-Known Member Licensed User Longtime User May 17, 2019 #1 I have see b4j_senddata in the b4j_ws.js. How does it work with srvr.AddWebSocket ? I want to send data(json format) to server side. example : b4j_senddata('{'D1':1,'D2':2}') --> server side, how to programmig ? B4X: function b4j_sendData(data) { b4j_ws.send(JSON.stringify({type: "data", data: data})); }
I have see b4j_senddata in the b4j_ws.js. How does it work with srvr.AddWebSocket ? I want to send data(json format) to server side. example : b4j_senddata('{'D1':1,'D2':2}') --> server side, how to programmig ? B4X: function b4j_sendData(data) { b4j_ws.send(JSON.stringify({type: "data", data: data})); }
Erel B4X founder Staff member Licensed User Longtime User May 19, 2019 #2 Why have you omitted the important comment: //only called as a result of a server request that is waiting for result. //this method should not be called in any other case. You can use b4j_raiseEvent to call a server sub. Upvote 0
Why have you omitted the important comment: //only called as a result of a server request that is waiting for result. //this method should not be called in any other case. You can use b4j_raiseEvent to call a server sub.