Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery mobile, cannot get it to change page using $.mobile.changePage
    primarykey
    data
    text
    <p>I am using the following code to programmatically change the page in my app with phonegap:</p> <pre><code>$('#selection').change(function() { alert($(this).val()); $.mobile.changePage($("#about"), "slideup"); }); </code></pre> <p>When the user changes the selection, the alert fires off and in theory should send them to the following jquery object.</p> <pre><code> &lt;div data-role="page" id="about" data-id="about"&gt; &lt;div data-role="header" data-position="fixed" data-nobackbtn=”false”&gt;&lt;h1&gt;About Us&lt;/h1&gt;&lt;/div&gt; &lt;div data-role="content"&gt; &lt;p&gt;Information about the company&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>The object works fine with normal linking</p> <pre><code>&lt;span&gt;&lt;a href="#about" data-transition="fade"&gt;About Us&lt;/a&gt;&lt;/span&gt; </code></pre> <p>But I cannot get it to load programmtically in the browser or within phone gap.</p> <p>Any ideas? I must have looked up the API a million times.</p> <p>Full html is as follows:</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Header&lt;/title&gt; &lt;script type="text/javascript" charset="utf-8" src="js/phonegap-0.9.3.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="css/jquery.mobile-1.0a1.min.css" /&gt; &lt;script src="js/jquery-1.4.3.min.js"&gt;&lt;/script&gt; &lt;script src="js/jquery.mobile-1.0a1.min.js"&gt;&lt;/script&gt; &lt;script src="js/mycustomjs.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; // PhoneGap is loaded and it is now safe to make calls PhoneGap methods // function onDeviceReady() { function reachableCallback(reachability) { // There is no consistency on the format of reachability var networkState = reachability.code || reachability; var states = {}; states[NetworkStatus.NOT_REACHABLE] = 'No network connection'; states[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection'; states[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection'; alert('Connection type: ' + states[networkState]); } navigator.network.isReachable('phonegap.com', reachableCallback); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;!-------------- INDEX PAGE ------------------------------------&gt; &lt;div data-role="page" id="home"&gt; &lt;div data-role="header" data-position="fixed" data-nobackbtn=”false”&gt; &lt;h1 header&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;p&gt;Thank you for downloading our app&lt;/p&gt; &lt;div data-role="fieldcontain"&gt; &lt;label for="selection" class="select"&gt;Please select an industry&lt;/label&gt; &lt;select name="selection" id="selection"&gt; &lt;option value="choice1"&gt;choice1&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-------------- ABOUT PAGE ------------------------------------&gt; &lt;div data-role="page" id="about" data-id="about"&gt; &lt;div data-role="header" data-position="fixed" data-nobackbtn=”false”&gt; &lt;h1&gt;About Us&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;p&gt;Information about the company&lt;/p&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.
 

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