We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let's say you create web app. It's like diary or something which based on year-month-day data from URL.
http://example.com/2012/12/27/
Then, I want API like this.
router.route([ path: /\/([^\/]+)\/([^\/]+)\/([^\/]+)\//, /* ex: /year/month/day/ */ avoidpagefetch: true, insteadpagefetch: function(page, path){ $('#main').html(pageframehtml); var year = path.matchedPathFragments[0]; var month = path.matchedPathFragments[1]; var day = path.matchedPathFragments[2]; callMyApi(year, month, day).done(function(data){ updateSomethingFromData(data); page.trigger('pageready'); }); } ]);
I may implement a thing like this.
The text was updated successfully, but these errors were encountered:
var loading = new Loading(); router.route([ path: /\/([^\/]+)\/([^\/]+)\/([^\/]+)\//, /* ex: /year/month/day/ */ skippagefetch: true, pageready: function(location){ loading.show(); console.log(location.rip(0)); // year console.log(location.rip(1)); // month console.log(location.rip(2)); // day callAjaxApiOrSomething(year, month, day).done(function(data){ renderViewOrSometing(data).done(function(){ loading.hide(); }); }); }); ]);
This may be enough because non-history-supported browser can handle only pageready. All we need here seems the location object above.
location
Sorry, something went wrong.
Location object needs to handle get values like below, too.
http://example.com/foobar/?foo=bar I need to parse the value like above in URL routing. Davis.js handles this. But we need to handle it even if the user can't use history.pushState.
http://example.com/foobar/?foo=bar
I need to parse the value like above in URL routing. Davis.js handles this. But we need to handle it even if the user can't use history.pushState.
No branches or pull requests
Let's say you create web app. It's like diary or something which based on year-month-day data from URL.
http://example.com/2012/12/27/
Then, I want API like this.
I may implement a thing like this.
The text was updated successfully, but these errors were encountered: