I have seen this related question where jQuery mobile loads into DOM. However, in that case, ajax loading was enabled and he was using window.location
to move across pages.
I am not using window.location
, just normal hyperlinks, and I have turned off ajax loading:
$(document).ready(function() {
// disable page transitions
$.mobile.ajaxEnabled = false;
$.mobile.defaultPageTransition = 'none';
}
Nonetheless, if I:
- Start on page A
- Click a link to page B
- Click the back button on my Android phone
- Click a link to page C
The following happens:
- Page C loads in its entirety, including all JavaScript and media
- The [loading...] graphic appears
- The content of page A loads into the page
This is not reliable; sometimes the content is from an even earlier page.
Note that in step 3, clicking the jQuery mobile-generated back button results in the same behavior.
Note that this even happens for links which are explicitly marked as data-ajax="false"
.
Also, this does not occur on desktop browsers, only Android (and it also appears to happen in the iPhone, although I've only tested it via the simulator).