Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery mobile refresh index page on back button
    primarykey
    data
    text
    <p>I have an index page that dynamically loads a json object. if I go to a second page and then I try to go back to the index using back button I'd like to reload index page, so it reloads the json object that could be changed. This is my <code>index.html</code> page code:</p> <pre class="lang-html prettyprint-override"><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Test&lt;/title&gt; &lt;meta charset="utf-8" /&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1" /&gt; &lt;link rel="stylesheet" href="jquery.mobile-1.2.0.min.css" /&gt; &lt;script src="js/jquery-1.8.2.min.js"&gt;&lt;/script&gt; &lt;script src="jquery.mobile-1.2.0.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="cordova-2.2.0.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page" id="pagina"&gt; &lt;div data-role="header" data-position="fixed" data-theme="d"&gt; &lt;h1 style="font-size:14px"&gt;test&lt;/h1&gt; &lt;/div&gt;&lt;!-- /header --&gt; &lt;div data-role="content" id="content"&gt; &lt;ul data-role="listview" id="ul_id" data-theme="b" data-inset="true"&gt; &lt;/ul&gt; &lt;/div&gt;&lt;!-- /content --&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; &lt;script&gt; $.getJSON('http://www.test.com/test.php', function(data) { var items = []; $.each(data, function(key, val) { $('#ul_id').append($('&lt;li&gt;&lt;a href="' + val +'.cfm" id="'+ val +'"&gt;&lt;h3&gt;' + key + '&lt;/h3&gt;&lt;/a&gt;&lt;/li&gt;')); }); $('#ul_id').listview('refresh'); }); &lt;/script&gt; </code></pre> <p>How can I do it?</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.
    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