This repository was archived by the owner on Oct 8, 2021. It is now read-only.
Fixed bug that throws an error in $.mobile.changePage#4890
Closed
ryankirkman wants to merge 1 commit intojquery-archive:masterfrom
Closed
Fixed bug that throws an error in $.mobile.changePage#4890ryankirkman wants to merge 1 commit intojquery-archive:masterfrom
ryankirkman wants to merge 1 commit intojquery-archive:masterfrom
Conversation
… return an empty string when the absUrl == documentUrl.hrefNoHash with a # on the end
|
Can you please provide a demo page illustrating this problem? You can use our handy jsbin template to start with. It would also be nice if you could add a unit test that fails unless your patch is applied. You can add your test to the navigation unit test suite located in the source tree's tests/unit/navigation subdirectory. The most important thing is the demo though. Don't worry if you can't get around to writing the unit test. |
Contributor
|
no reply for test case and function is deprecated closing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The error is thrown at: https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.navigation.js#L1098
To replicate the bug you need a specific set of conditions:
https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.navigation.js#L1017 will incorrectly return an empty string because the call to
path.convertUrlToDataUrl( settings.dataUrl )incorrectly returns an empty string whensettings.dataUrllooks likehttp://example.com/myapp/#- note the#on the endTo fix the bug
path.convertUrlToDataUrl( ... )at https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.navigation.js#L180 needs to add an additional check at https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.navigation.js#L182 to ensure!path.isFirstPage( absUrl )NB: This bug has only arisen because I am bypassing jquery mobile navigation and using backbone's router.