B4J Question [BANano] running example Server Client project fails (version 1.05)

Discussion in 'B4J Questions' started by mindful, Dec 10, 2018.

  1. mindful

    mindful Active Member Licensed User

    Hello, I wanted to try the new BANano framework and I can't get it to run :(

    I installed the chrome local web server which works but when I access the localhost:8887/client.html it gives an error in console:

    The error is : Uncaught SyntaxError: Unexpected identifier

    And it is raise at : if (await banano_isconnectedWait()) { from the code below:
    Code:
    // [58public Sub Login_Clicked(event As BANanoEvent) 
    this.login_clicked= function(_
    event) {
    if (self==null) self=this;
    var _token;
    // [
    59]  Dim Token As String = BANano.GetCookie( {45} ) 
    _token=(Cookies.get("BANanoDemoCookie") || '');
    // [60]  If Token = {46} Then 
    if (_token == "") {
    // [61]  If BANano.CheckInternetConnectionWait Then 
    if (await banano_isconnectedWait()) {
    // [63]  BANano.GetElement( {47} ).SetChecked(True) 
    u("#loginform").checked(true);
    // [64]  Else 
    } else {
    // [66]  MiniCSS.Content( {48} , {49} , {50} ) 
    _banano_minicss.content("r3c1","contajax","You are not connected to the internet!");
    // [67]  End If 
    }
    // [68]  Else 
    } else {
    // [69]  BANano.RemoveCookie( {51} , {52} ) 
    Cookies.remove("BANanoDemoCookie", {});
    // [71]  MiniCSS.Button( {53} , {54} , {55} , {56} , Me, True) 
    _banano_minicss.button("r1c1","login","Login","primary",_banano_bananoclient,true);
    // [72]  MiniCSS.Content( {57} , {58} , {59} ) 
    _banano_minicss.content("r3c1","contajax","You are now logged off from the server!");
    // [73]  End If 
    }
    // End Sub

    };
    I didn't modify the project in anyway ... I just compiled and pointed to chrome local web server to the compiled app path (BANanoClient).
     
  2. alwaysbusy

    alwaysbusy Expert Licensed User

    Yes, I've noticed this just myself. My test was buffered and did't had this test. Just until I can fix it, remove the 'If BANano.CheckInternetConnectionWait Then' check in Login_Clicked().

    for some reason, this line is missing the async keyword:

    Code:
    this.login_clicked= function(_event) {
     
    mindful likes this.
  3. alwaysbusy

    alwaysbusy Expert Licensed User

    mindful likes this.
  4. mindful

    mindful Active Member Licensed User

    another error now: Uncaught SyntaxError: Unexpected token var

    in app.js:1 (i can't pretty format): (""+void 0==typeof global?""+void 0==typeof self?this:self:global)var bananoglobal=this;
     
  5. mindful

    mindful Active Member Licensed User

    it's missing a ";" after the ) and before the var


    I edited the app.js manually and added the ; and it's working now.

    Great work!
     
    alwaysbusy likes this.
  6. alwaysbusy

    alwaysbusy Expert Licensed User

    If you re-download BANano1.06.zip, the ; should be fixed too.
     
  7. mindful

    mindful Active Member Licensed User

    Done and it's working ;)
     
    alwaysbusy likes 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