JQM (jQueryMobile) Click the last page from the DOM on changePage ()

I notice that the page I was just browsing is still in the DOM. Is there a way to delete the last page viewed after going to a new page using changePage ()?

I turned off all reverse navigation, as I do not want the usage to return to the last page when switching to a new page.

Any suggestions?

Site Stream:

  • main page-> fill in the information-> send to changePage ()
  • next page-> fill out more-> send to changePage ()
  • etc...

After submitting the page, I no longer need

UPDATE:

Here is the first page:

<div data-role="page" id="first_page" data-theme="z" data-backbtn="false" data-url="first_page" class="ui-page ui-body-z"> 

He adds something to this when adding a new page:

 <div data-role="page" id="next_page" name="next_page" data-theme="z" data-title="next_page" data-url="getNextPage.php?page=next_page" class="ui-page ui-body-z"> 

The call to live () is as follows:

 // pageName[index] = next_page $('#'+pageName[index]).live('pagecreate',function(event, ui){ $(ui.prevPage).remove(); 

using changePage () as follows:

 $.mobile.changePage('getNextPage.php?page='+pageName[index],'slide',false,false); 
+7
source share
2 answers

I donโ€™t know, knowing your markup, I assume that you run changePage() manually. If so, you can link one of the events listed here .

pageshow
Off on the page is shown after completion of its transition.

 $('div').live('pageshow',function(event, ui){ $(ui.prevPage).remove(); }); 

Jsfiddle example .

+11
source

I'm not sure if this is due to your problem, but JQM was fixed, which yesterday was due to errors when trying to delete DOM elements: https://github.com/jquery/jquery-mobile/commit/d4c7b5da66641a3fd081a834ca3d12a5518d499b

0
source

All Articles