Skip to content
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
ryankirkman:master
Closed

Fixed bug that throws an error in $.mobile.changePage#4890
ryankirkman wants to merge 1 commit intojquery-archive:masterfrom
ryankirkman:master

Conversation

@ryankirkman
Copy link

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 when settings.dataUrl looks like http://example.com/myapp/# - note the # on the end

To 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.

… return an empty string when the absUrl == documentUrl.hrefNoHash with a # on the end
@gabrielschulhof
Copy link

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.

@arschmitz
Copy link
Contributor

no reply for test case and function is deprecated closing

@arschmitz arschmitz closed this Aug 6, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants