Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I was able to resolve this issue by using the <a href="https://github.com/jblas/jquery-mobile-plugins/blob/master/page-params/jqm.page.params.js" rel="nofollow noreferrer">jqm.page.params</a> plugin with help from <a href="https://stackoverflow.com/questions/8238762/passing-parameters-to-a-page-id-in-jquery-mobile">this</a> question on stackoverflow. Here is my code for using this plugin:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" /&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"&gt;&lt;/script&gt; //Added the jqm.page.params plugin &lt;script src="https://raw.github.com/jblas/jquery-mobile-plugins/35fcf54e2af380aa0e98e9f384572b02f58a1ea1/page-params/jqm.page.params.js"&gt;&lt;/script&gt; &lt;script&gt; $("#page2").live('pageshow', function(e) { alert($(e.target).attr("data-url")+$.mobile.pageData.id); //$("#page_text").html("Page 2"+($(e.target).attr("data-url").replace(/.*id=/, ""))); $("#page_text").html("Page 2"+$.mobile.pageData.id); }); $(document).bind("pagebeforechange", function( event, data ) { $.mobile.pageData = (data &amp;&amp; data.options &amp;&amp; data.options.pageData) ? data.options.pageData : null; }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page" data-theme="c" id="page1"&gt; &lt;div data-role="content"&gt; &lt;p&gt;Page 1&lt;/p&gt; &lt;a href ="#page2?id=a" data-transition="flip" data-role="button"&gt;Page 2a&lt;/a&gt; &lt;a href ="#page2?id=b" data-transition="flip" data-role="button"&gt;Page 2b&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div data-role="page" data-theme="a" id="page2"&gt; &lt;div data-role="content"&gt; &lt;p id="page_text"&gt;&lt;/p&gt; &lt;a href ="#page1" data-transition="flip" data-role="button"&gt;Page1&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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