How to change page in jQuery mobile (1.4 beta)?
As of jQuery Mobile 1.4, $.mobile.changePage()
is deprecated and replaced with:
$(":mobile-pagecontainer").pagecontainer("change", "target", { options });
Shortened...
$.mobile.pageContainer.pagecontainer("change", "target", { options });
Even shorter...(1)
$("body").pagecontainer("change", "target", { options });
Note: target is #page_id or URL.
(1) <body>
is pageContainer by default, unless $.mobile.pageContainer
is modified on mobileinit
.
This works for me:
$.mobile.pageContainer.pagecontainer('change', nextPage, { transition: 'flow', reload : true});
nextpage: is URL to the nextpage example (var nextPage = 'nextPage.html')