Note that there are some explanatory texts on larger screens.

plurals
  1. POLoading jQuery Mobile page from navbar doesn't load javascript
    primarykey
    data
    text
    <p>I was able to reference <a href="https://stackoverflow.com/questions/10540219/jquery-mobile-change-page-doesnt-load-js-files">this stackoverflow question</a> to realize that JS scripts needed to be nested within the data-role page element in order to get it to load when the page is accessed by AJAX. But for a code like the following, which allows a user to swipe left and right <em>among</em> pages, you really can't just load the script for page 1 (in other words, it needs to access all of the data-role=page elements). What recourse does one have if you access this page via AJAX?</p> <pre><code>$('div.ui-page').live("swipeleft", function(){ var nextpage = $(this).next('div[data-role="page"]'); if (nextpage.length &gt; 0) { $.mobile.changePage(nextpage,{transition: "slide", reverse:false}, false, true); } }); $('div.ui-page').live("swiperight", function(){ var prevpage = $(this).prev('div[data-role="page"]'); if (prevpage.length &gt; 0) { $.mobile.changePage(prevpage, {transition: "slide", reverse: true}, true, true); } </code></pre> <p>Demo: Click on the Danger tab (doesn't work even though it sends you to multipage.php): <a href="https://stanford.edu/~rakasaka/cgi-bin/cs147/week5/index.php" rel="nofollow noreferrer">https://stanford.edu/~rakasaka/cgi-bin/cs147/week5/index.php</a></p> <p>Alternatively, reload the multipage.php and swipe left and right: <a href="https://stanford.edu/~rakasaka/cgi-bin/cs147/week5/multipage.php" rel="nofollow noreferrer">https://stanford.edu/~rakasaka/cgi-bin/cs147/week5/multipage.php</a></p> <p>It should work, because the JS is loaded.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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