Comments (3)
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.
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.
Sounds good.
from senna.js.
Related Issues (20)
- Senna does not correctly evaluate favicon when page changes
- Turn Cache on Screens off HOT 4
- endNavigate when instantiated via data attributes HOT 3
- Senna.js not working when navigating between pages when using a Web Server + SSL on IE11 HOT 2
- Browser support matrix doesn't mention support for any browser other than Edge in Windows 10 HOT 14
- Query appending to IE11 link
- Page keyword metatag is not being refreshed after page navigation HOT 2
- how to use asp.net mvc scene? HOT 1
- In IE11, media queries in style tags with data-senna-track attributes are applied as though the page has a width of 0px HOT 14
- Add custom behavior when a Redirect happens (302) HOT 4
- Senna moves focus away from autoFocus fields on refresh HOT 3
- Start navigation on mousedown instead of on click HOT 2
- Redirect Path passed to the historyState don't support hashes
- Back button reloads the inital page HOT 1
- How to flip a specific surface only? HOT 1
- Dynamically added classes to the head element gets removed on page change HOT 1
- Branch 3.x and move 2.x to master
- Cleanup long-standing PRs HOT 3
- Mio de mi HOT 1
- Saving app.screens into localStorage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from senna.js.