Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>EDITED:</strong><br> It seems that when using a multipage template approach (single html with all pages included) then <code>pageinit</code> is fired once since the pages are loaded in DOM and remain there when transitioning between pages.</p> <p>However when using multiple pages and navigating though Ajax you will notice that the pages contain an attribute <code>data-external-page="true"</code> except the first page. The first page is always cached in DOM even if you're using domCache false. But the pages except the first page are loaded and cleaned out after you leave them. That's why <code>pageinit</code> is fired on back/forward button clicks.</p> <p>The <em>domCache</em> sets whether to keep the page in the DOM after the user has navigated away from it. You can read about it on <a href="http://api.jquerymobile.com/page/" rel="nofollow">jQM docs</a>. By default the <em>domCache</em> option's value is <em>false</em>.</p> <p>Adding:</p> <pre><code>$(document).on('mobileinit', function () { $.mobile.page.prototype.options.domCache = true; }); </code></pre> <p>between jQuery js and jQuery Mobile js will cause the pages to be cache in DOM. Therefore pageinit will not fire.</p> <p>An alternative is to add <code>data-dom-cache="true"</code> on your anchor.</p> <p>The <strong>drawback</strong> of using domCache is that the DOM can be large, resulting in <strong>memory issues</strong>. In a such approach the DOM management is left on the developer.</p> <p>At last make sure that you're using the same jQ, jQM versions in your pages. The first 2 pages are using jQ 1.9.1, jQm 1.3.1 and the third page is using jQ 1.7.1, jQM 1.1.0. This is irrelevant with the specific issue but it worth to mention it.</p> <p>I hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload