Giter Site home page Giter Site logo

Comments (3)

eduardolundgren avatar eduardolundgren commented on May 22, 2024

If you are using Senna from the constructor you don't need the data attributes.
The debug file will log Senna not initialized from data attribute, try passing <body data-senna>. always when used from JavaScript.

var app = new senna.App();
  app.setBasePath('/examples/mysite/pages/');
  app.addSurfaces('content');
  app.addRoutes([
    new senna.Route('page1.html', senna.HtmlScreen),
    new senna.Route('page2.html', senna.HtmlScreen)
  ]);

This code looks fine, isn't this working for you? Make sure the base path is correct. And try to put this script tag on the bottom of your page just to make sure you are not running into some possible lazy-surface problem since you add it before dom is ready.

from senna.js.

FagnerMartinsBrack avatar FagnerMartinsBrack commented on May 22, 2024

Make sure the base path is correct

Yeah, I was on /test/main.html but did not specified the basePath:

app.setBasePath( "/test/" )

And try to put this script tag on the bottom of your page just to make sure you are not running into some possible lazy-surface problem since you add it before dom is ready.

Senna is working properly through plain JS once I realized the basePath was missing, the scripts at the top were ok.

Also, it seems I missed completely senna's main constructor while inspecting the code's behavior lol.

Anyway, question answered.

from senna.js.

eduardolundgren avatar eduardolundgren commented on May 22, 2024

Sounds good.

from senna.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.