Skip to content
New issue

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

Would it be good to make navigator.request accept anchor DOM elements, so it can figure out internally what the path should be? #35

Open
PaulTondeur opened this issue Oct 3, 2013 · 0 comments

Comments

@PaulTondeur
Copy link
Member

$("a").on("click", function(e) {
    e.preventDefault();
    navigator.request(e.target)
});

We might also allow the request to take the event parameter so we can do:

$("a").on("click", navigator.request);

In that case the navigator should prevent the default, find out the href of the clicked element and set that state. Prior to preventing the default we might want to check first if it will be a valid state to navigate to?
This provides a convenient way to request states from anchors on the page. But maybe navigator.request() starts to do too much magic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant