3 ms·
That is how Backbone and all other current frameworks work.
by ricardobeat 14y ago
That is how Backbone and all other current frameworks work.
- superfreek 14y agoNo it isn't.
- ricardobeat 14y agoCare to explain? They use pushState or hashes for routing, and load data via XHR. If you are using pushState it is assumed that the URL must exist on the server.
- cheapsteak 14y agoHaving the URL exist on the server isn't the same as serving a rendered page from the URL, which is what most SPAs do. You could just rewrite all URLs in a website to point back to your index.html, then have the client side router initialize the app from the URL parameters. If you don't have javascript turned on (e.g. googlebot) then all you'll see is a blank page
- ricardobeat 14y agoGooglebot interprets javascript. In that case you shouldn't use pushState but fragment URLs[1]. I should have said it is assumed that the URL exists on the server and points to the same resource/content; otherwise setting URLs using pushState makes no sense. GitHub is a good example of how it should be done, not an exception. [1] https://developers.google.com/webmasters/ajax-crawling/docs/getting-started https://developers.google.com/webmasters/ajax-crawling/docs/...