Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery single page mobile app
    text
    copied!<p>I am trying to build a jQuery app with multiple page. Where different pages are placed in different html files. <strong>index.html</strong></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Dynamic Page Example&lt;/title&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;sciprt src="abc.js"&gt;&lt;/sciprt&gt; &lt;div data-role="page" id="home" data-title="Welcome"&gt; &lt;div data-role="header"&gt; &lt;h1&gt;Dynamic Page&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;input type=button id="changePage" value="Open dynamic page"&gt; &lt;!--&lt;a href="abc.html" data-prefetch&gt;abc&lt;/a&gt;--&gt; &lt;/div&gt; &lt;script&gt; $("#changePage").on("click", function() { // Create page markup // Enhance and open new page $.mobile.changePage('abc.html'); }); &lt;/script&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>abc.html</strong></p> <pre><code>&lt;div data-role=page data-url=hi id=abc&gt; &lt;div data-role=header id=first&gt; &lt;h1&gt; &lt;script&gt; document.write(msg.first);&lt;/script&gt; &lt;/h1&gt; &lt;/div&gt; &lt;div data-role=content id=second&gt; &lt;script&gt; document.write(msg.second);&lt;/script&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>abc.js</strong></p> <pre><code>var msg = { first : 'I am First', second : 'I am Second', third : 'I am Third' }; </code></pre> <p>I don't understand where i am doing wrong.When there is no javascript im abc.html then it works, but when i try to use js, it just shows loading.</p> <p>Any help would be great....</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