Organizational Research By

Surprising Reserch Topic

how to change page in jquery mobile 1 4 beta


how to change page in jquery mobile 1 4 beta  using -'jquery,api,jquery-mobile,webpage'

I am reading the docs that $.mobile.changePage has been deprecated.

But it doesn't say in favor of what, or what can I use instead.

Is there a new API documentation page for this?

I used to use $.mobile.changePage("index.html", {reloadPage:true}); but it seems that adding reloadPage:true the page breaks
    

asked Sep 14, 2015 by QAVCry
0 votes
23 views



Related Hot Questions

2 Answers

0 votes

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.

Demo


(1) is pageContainer by default, unless $.mobile.pageContainer is modified on mobileinit.

answered Sep 14, 2015 by RoxKYP
0 votes

This works for me:

$.mobile.pageContainer.pagecontainer('change', nextPage, {
  transition: 'flow',
  reload    : true
});

nextpage: is URL to the nextpage example (var nextPage = 'nextPage.html')

answered Sep 14, 2015 by AdolfoDocker

...