azicchetti/jquerymobile-router — Issue #24: changePage triggers wrong events
Author: brianantonelli
Created: 2012-02-13 18:13:03+00:00
State: open

Most of my app follows the multipage model but there are one or two edge cases when I do a changePage and refer to the page's DOM ID instead of its data URL. This works correctly with JQM but JQMR invokes the events for the previously loaded page due to the lack of a URL change.

Example:
1) Browser is at http://test.com/index.html (page ID = "index")
2) Browser navigates to http://test.com/index2.html
3) JS command: $.mobile.changePage($("#index"));
4) Page changes to index.html but URL remains at index2.html. All page show events are reinvoked for index2.html when the page change events fire.

I know this is a pretty weird scenario but just wanted to make sure that it got documented.