Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery mobile url parameter not updating in browser, but getting correct one with "data-url"
    text
    copied!<p>I created the following example to show what I am experiencing. </p> <p>If I navigate from page1 to page 2 with the button Page 2a, the URL will be ...#page2?id=a as expected. </p> <p>When I click the button to go back to Page 1, then navigate to Page 2b, the URL will still show "#page2?id=<strong>a</strong>", but the <code>&lt;a&gt;</code> tag is clearly has an href of "#page2?id=<strong>b</strong>" along with the <code>$(e.target).attr("data-url")</code> being "#page2?id=<strong>b</strong>" when I get to #page2. </p> <p>Any ideas what is going on here? Thanks in advance for any help.</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; &lt;script&gt; $("#page2").live('pageshow', function(e) { alert($(e.target).attr("data-url")); $("#page_text").html("Page 2"+($(e.target).attr("data-url").replace(/.*id=/, ""))); }); &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> <p>Code sample is <a href="http://jsfiddle.net/UZM3B/2/" rel="nofollow">here</a> on jsfiddle too.</p>
 

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