I am using the backbone boilerplate here
https://github.com/tbranyen/backbone-boilerplate
I do development in static html/js offline and do test offline before uploading to another pre-production site online. What annoyed me is that the router works in pre-production but not offline. This is the root for pre:
var app = {
// The root path to run the application.
root: "/myfolder/"
};
This is the URL for online pre-production:
http://www.mywebsite.com/myfolder/index.html
This is URL for offline:
file:///C:/Users/MyHome/Desktop/MyProject/MyApp/index.html
What do I use for root in offline? Is there a way NOT to keep changing root every time I upload to pre-production? Or does router not working in static html at all?
p.s. This is the code in main.js
Backbone.history.start({ pushState: true, root: app.root });
Never mind. After doing some reading, pushState does not work with file protocol
https://github.com/mtrpcic/pathjs
http://html5doctor.com/history-api/
The HTML5 Mozilla document doesn’t say this though.