Note that there are some explanatory texts on larger screens.

plurals
  1. POPhoneGap Android jQuery Mobile app runs on device without CSS/JS
    primarykey
    data
    text
    <p>I've got a Phonegap (Cordova 2.0.0) app, built for Android, running with jQuery Mobile + Backbone.js. When I test it on the emulator, it works correctly (runs as in the browser, CSS and JS appear, etc).</p> <p>When I sign it and install it on a non-debug device, it runs but without the CSS and JS (so basically shows an unstyled HTML document which doesn't run the JS).</p> <p>The body of my app is as follows:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;My App&lt;/title&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" /&gt; &lt;meta charset="utf-8"&gt; &lt;link rel="stylesheet" href="libraries/jquery.mobile-1.1.1.min.css" /&gt; &lt;link rel="stylesheet" href="assets/css/style.css" /&gt; &lt;script src="http://localhost:8080/target/target-script-min.js#anonymous"&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8" src="libraries/cordova-2.0.0-ios.js"&gt;&lt;/script&gt; &lt;script src="libraries/jquery-1.7.2.min.js"&gt;&lt;/script&gt; &lt;script src="libraries/underscore.js"&gt;&lt;/script&gt; &lt;script src="libraries/backbone-min.js"&gt;&lt;/script&gt; &lt;script src="libraries/backbone.localStorage-min.js"&gt;&lt;/script&gt; &lt;script src="libraries/detect.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="libraries/sha1.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="app.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var jqmReady = $.Deferred(); var deviceReady = $.Deferred(); /** * on load - manages dependency between jquery mobile and phonegap */ function onBodyLoad() { // get device $.os = {}; $.os.android = navigator.platform.indexOf("android")&gt;=0; $.os.ios = navigator.platform.indexOf("iPhone")&gt;=0 || navigator.platform.indexOf("iPad")&gt;=0; // listen to device ready if ($.os.android || $.os.ios) { document.addEventListener("deviceready", deviceReady.resolve, false); } else { // must be in a browser, so immediately resolve deviceReady.resolve(); } } $(document).bind("mobileinit", jqmReady.resolve); $(document).bind("mobileinit", function() { console.log('mobileinit'); }); $(document).bind('pageinit', function() { console.log('pageinit'); }); // when jquery mobile and device ready, then fire $.when(jqmReady, deviceReady).then(function() { console.log('Ready'); // disable push state: http://jquerymobile.com/demos/1.1.1/docs/pages/page-links.html $.mobile.pushStateEnabled = false; App.init(); }); onBodyLoad(); &lt;/script&gt; &lt;/head&gt; &lt;body onload="" data-lat="" data-lng=""&gt; </code></pre> <p>Has anyone come across this before? I was wondering if it's something to do with the relative paths (rather than absolute?) or how I package it together in Eclipse. Also, on an iPhone it works fine.</p> <p>Thanks.</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.
    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