jQuery-Mobile-Subpage-Widget icon indicating copy to clipboard operation
jQuery-Mobile-Subpage-Widget copied to clipboard

Can I use $.mobile.changePage() to switch between pages?

Open solveitinc opened this issue 11 years ago • 5 comments

Before this plugin, I was forced to use data-ajax=false to properly load multiple jqm pages into the DOM. I would like to start "ajaxing in" my multi-page template, so I tried this plugin.

Unfortunately, I seem to have lost the ability to programmatically switch between the pages. I was previously using $mobile.changePage("#pageDivName"); to move from one jqm "page" to the next, but it isn't working after implementing the plugin. jQuery mobile is throwing an error stating "Unable to get property '_trigger' of undefined or null reference." This is on line 4065 of jquery.mobile-1.3.1.js.

Is there a trick to getting changePage to work with this plugin? Thanks.

capture

solveitinc avatar Dec 25 '13 22:12 solveitinc

Any idea guys?

solveitinc avatar Dec 27 '13 14:12 solveitinc

Once the page with the subpages is loaded, the subpages are inserted into the DOM as pages. Check your args to changePage(). Links to subpages definitely work, so you could also set breakpoints to see what the system (jQM) is doing.

Cheers, Todd

From: solveitinc [mailto:[email protected]] Sent: Friday, December 27, 2013 6:16 AM To: ToddThomson/jQuery-Mobile-Subpage-Widget Subject: Re: [jQuery-Mobile-Subpage-Widget] Can I use $.mobile.changePage() to switch between pages? (#29)

Any idea guys?

— Reply to this email directly or view it on GitHub https://github.com/ToddThomson/jQuery-Mobile-Subpage-Widget/issues/29#issuecomment-31261650 .Image removed by sender.

ToddThomson avatar Dec 27 '13 20:12 ToddThomson

Thanks Tood. I’ve spent the past few days looking into it but I haven’t had much luck figuring it out.

I am able to reproduce the issue by adding a second button to the SubpageParent file in your sample – but instead of linking to the subpage via href, I’m firing a little js and attempting to perform a $.mobile.changePage using $.mobile.changePage('#test-subpage');

The strange part is that is work if I refresh subpageparent, but breaks when I ajax in subpageparent.

From: Todd Thomson [mailto:[email protected]] Sent: Friday, December 27, 2013 3:08 PM To: ToddThomson/jQuery-Mobile-Subpage-Widget Cc: Corey O'Mara Subject: Re: [jQuery-Mobile-Subpage-Widget] Can I use $.mobile.changePage() to switch between pages? (#29)

Once the page with the subpages is loaded, the subpages are inserted into the DOM as pages. Check your args to changePage(). Links to subpages definitely work, so you could also set breakpoints to see what the system (jQM) is doing.

Cheers, Todd

From: solveitinc [mailto:[email protected]] Sent: Friday, December 27, 2013 6:16 AM To: ToddThomson/jQuery-Mobile-Subpage-Widget Subject: Re: [jQuery-Mobile-Subpage-Widget] Can I use $.mobile.changePage() to switch between pages? (#29)

Any idea guys?

— Reply to this email directly or view it on GitHub https://github.com/ToddThomson/jQuery-Mobile-Subpage-Widget/issues/29#issuecomment-31261650 .Image removed by sender.

— Reply to this email directly or view it on GitHubhttps://github.com/ToddThomson/jQuery-Mobile-Subpage-Widget/issues/29#issuecomment-31277956.

solveitinc avatar Dec 30 '13 14:12 solveitinc

http://m.integra-international.net/ Crush when update page.

it-Dima avatar Feb 08 '16 18:02 it-Dima

Sorry, http://m.integra-international.net/firms/directory/directory Crash when update page

it-Dima avatar Feb 08 '16 18:02 it-Dima