B4J Question How to use b4j_senddata ?

Discussion in 'B4J Questions' started by jinyistudio, May 17, 2019.

  1. jinyistudio

    jinyistudio Active Member Licensed User

    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 ?

    Code:
    function b4j_sendData(data) {
        b4j_ws.send(JSON.stringify({
    type"data", data: data}));
    }
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    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.
     
    jinyistudio and alwaysbusy like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice