B4J Question websockets - browser code ?

Discussion in 'B4J Questions' started by wl, Feb 14, 2015.

  1. wl

    wl Well-Known Member Licensed User

    Hi,

    I have gathered the necessary server and client code to use websockets. But I'm missing some instructions on how it works in a browser ?

    There used to be a chat demo but it is no longer available ?

    Tx
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. wl

    wl Well-Known Member Licensed User

    Erel,

    As far as websockets in a browser is concerned. Would it mean that something like the following works:

    Server-side:

    Code:
    ws.RunFunction("myFunction", SomeArrayOfStrings)
    Browser-side:

    Code:
    function myFunction() {
        var i;
        
    for (i = 0; i < arguments.length; i++) {
           ... arguments[i] ... 
    'is each item in the SomeArrayOfStrings I defined server-side.
        }
      }
    Would I need to pass an array of strings, a list of string, or would both work out ?

    Thanks !
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Both will work. You can also pass numbers or other types of variables.
     
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