• AJAX with SBBS

    From Mortifis@VERT/ALLEYCAT to All on Friday, April 10, 2020 18:28:11
    I was curious if the SBBS Web Server can handle AJAX; I believe is does xml with the xjs parser?

    ---
    Synchronet AlleyCat! BBS Lake Echo, NS Canada
  • From echicken@VERT/ECBBS to Mortifis on Friday, April 10, 2020 23:20:56
    Re: AJAX with SBBS
    By: Mortifis to All on Fri Apr 10 2020 18:28:11

    I was curious if the SBBS Web Server can handle AJAX; I believe is does xml
    with the xjs parser?

    Technically all Synchronet JS (including XJS/SSJS) does have some special XML-handling features. This come from an old JS extension called E4X:

    https://developer.mozilla.org/en-US/docs/Archive/Web/E4X

    However, it can be a pain to work with, and you probably don't *need* XML.

    It's a lot more straightforward to just pass JSON between the server and the client. An SSJS on the server only needs to respond with some stringified JSON, and the client just needs to JSON.parse it.

    On the browser-side, you can use XMLHttpRequest, or the Fetch API, or various client-side JS frameworks to make the requests.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com
    Synchronet electronic chicken bbs - bbs.electronicchicken.com
  • From Rampage@VERT/SESTAR to echicken on Saturday, April 11, 2020 08:33:14
    Re: AJAX with SBBS
    By: echicken to Mortifis on Fri Apr 10 2020 23:20:56


    echicken> It's a lot more straightforward to just pass JSON between the
    echicken> server and the client. An SSJS on the server only needs to
    echicken> respond with some stringified JSON, and the client just needs
    echicken> to JSON.parse it.

    oooooohhhh... this gives me an idea... the flightgear simulator can send JSON for html queries... i use it for a simple python script to pull the data for AI craft when i have FG running so i can see where craft are and their departure/arrival airports and similar data...

    the cool(?) idea i just had is to have a section in the BBS that works kinda like the interbbs messages thing where it polls FG occasionally, pulls the data and formats it for display in similar fashion to the interbbs message thing... read-only to start with as a type of monitor but imagine controlling an AI in the simulator via text instructions from a BBS ;)

    where's geneb? he's another FGer that might have some ideas in this vein -=B-)


    )\/(ark

    ---
    Synchronet The SouthEast Star Mail HUB - SESTAR