-
Notifications
You must be signed in to change notification settings - Fork 249
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
Trouble parsing query string on default route #96
Comments
Hey @lbssousa, I added a unit test but no luck reproducing your issue. I created a simple page with the following code: var router = new Navigo('http://home.dev/Krasimir/_tests/navigo/96/', false, '#!');
router.on(function (query) {
console.log('Query string: ' + query);
}).resolve(); And when I opened http://home.dev/Krasimir/_tests/navigo/96/?test=1 I got: So I'm not able to replicate the issue locally. Maybe if you provide an example. Also let me know OS and browser version. Do you use the latest Navigo release? |
Hmmm... Sorry, but I wasn't too accurate in my issue description. In fact, if I initialize the router with an explicit root URL (as in your test case), I'm able to catch the query string. The real issue occurs when I initialize the router with a default root URL (passing var router = new Navigo(null, false, '#!');
router.on(function (query) {
console.log('Query string: ' + query);
}).resolve(); In this case, I'm getting only an empty string for |
I finally reproduced the bug. Fixed in |
Yes! I've just upgraded my navigo version and now it parses the query string correctly! Thank you very much! |
I'm trying to parse a query string passed to my default route using navigo. Example URL:
Example code:
If I initialize my router with
useHash = false
, then I'm unable to parse the querycheck=1
(thequery
parameter in the handler function above only returns an empty string). However, if I setuseHash = true
, then I would be able to parse it, provided that I rewrite the URL above as follows:The text was updated successfully, but these errors were encountered: