Using jQuery mobile, I use the list view with the previous and next links to paginate. Everything works fine, but I do not want the previous and next pages to be added to the history stack. The idea is that strokes will only go to the previous page.
The only thing I found was to add data-rel = "dialog" to the tags, but I do not want this pop-up dialog box.
Otherwise, I tried to add
$.mobile.nonHistorySelectors="dialog,pagination"
for the mobileinit event, with the data-rel = "pagination" attribute added to the a tag. But this only causes errors when clicking links (the error also occurs even without adding non-historical elements to the mobileinit event).
EDIT:
The closest I found is JS
<script type="text/javascript"> $(".page-prev").click(function(e) { e.stopPropagation(); e.preventDefault(); $.mobile.changePage(this.href, {changeHash:false, reverse:true}); }); $(".page-next").click(function(e) { e.stopPropagation(); e.preventDefault(); $.mobile.changePage(this.href, {changeHash:false}); }); </script>
and this HTML
<a href="/blog?page=1" class="page-prev" data-role="button" data-icon="arrow-l">Prev</a> <a href="/blog?page=3" class="page-next" data-role="button" data-icon="arrow-r">Next</a>
Itβs like the browser history wouldnβt be updated, but sometimes when you click on the page, the sliding pages will do some funky things, such as loading / changing twice. Plus, one thing he cannot do is that if I went to a page from here and came back, she would go back to page 1.
jquery jquery-mobile
Tyler Clendenin
source share