Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Mobile caching link to relative page
    primarykey
    data
    text
    <p>I'm having an issue with jQuery Mobile links to a dynamic page. </p> <p>I have a list of links generated with a relative link like this:</p> <pre><code>&lt;a href="#page2?q=Foo"&gt;Foo&lt;/a&gt; &lt;a href="#page2?q=Bar"&gt;Bar&lt;/a&gt; </code></pre> <p>And on the page <code>page2</code>, I use the data in the query string to populate fields dynamically.</p> <p>The problem is, if I click on <code>Foo</code>, go back, and click on <code>Bar</code>, JQM actually takes me to <code>#page2?q=Foo</code> again. I tried setting <code>data-cache="never"</code> on <code>page2</code> but with no luck. Any idea why the link isn't actually going to what it is, but the first that was clicked since page load?</p> <p>Edit: example site <s>here</s> [fixed]. Just click on any item, go back, and try to go to another one. You'll get the first again.</p> <p><strong>Edit:</strong> I've tried setting data-dom-cache="false" which doesn't help, as it isn't that the page is cached, but that the link is cached (maybe?). I've also tried removing the page from the DOM, but then when I try to re-navigate to the page, I am unable, as it is gone.</p> <p>I tried to work around this problem by simply programmatically setting the page value on click/tap, but this doesn't work when trying to load a specific page (for bookmarking/deep-linking). </p> <p><strong>Edit 2:</strong> I think I have found a related issue that may be causing this one. When I load up each page, I parse out the document.location.search. Oddly, with URLS like </p> <pre><code>http://.../#route-page?route=test http://.../#route-page?route=test2 </code></pre> <p>document.location.search should return <code>?route=test</code> and <code>?route=test2</code> and document.locations.hash should return <code>#route-page</code> for both. What I'm actually getting is empty strings for document.location.search and the entire thing for document.location.hash: <code>#route-page?route=test</code>. Am I using these two properties wrong?</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.
 

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