简体   繁体   中英

Manipulate History in jQuery Mobile

I've stumped into a problem with my mobile app. After submitting a non-Ajax form and reloading the page, my back button simply reloads the same page since there are, I assume, two entries for the item page.

The flow:

View List Page

View Item Page

Click Edit

Submit Form on Edit Dialog (submits / non-AJAX)

View Item Page

Click Back

View Item Page

Is there any way to exclude the 2nd View Item Page from the history stack?

I also faced same problem in my application. Following code will give solution for your problem.

      window.history.go(-attempt);

attempt mean how many time you change (click) the page. I used pagebeforechange event to count the number of attempts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM