1

i followed this Guide to create my first PhoneGap app: http://cleancodedevelopment-qualityseal.blogspot.de/2012/12/first-phonegap-app-with-android-using.html This works fine. Now, i want to use JQuery Mobile in this application.

I downloaded three files and put them into the same directory as my index.html. The head of the index.html looks like this:

<link rel="stylesheet" href="jquery.mobile-1.3.1.min.css" />
<script src="cordova-2.6.0.js"></script>
<script src="jquery.mobile-1.3.1.min.js"></script>
<script src="jquery-1.9.1.min.js"></script>

doesnt work. when i using the "online version" of jquery mobile, like this:

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>

it works. But i want to make an offline app. any idea?

1
  • Make sure that the path you are giving is correct if so, get the online version and keep that file inside your directory. But you still there are chances to miss the images which is used in the css file. Commented Apr 19, 2013 at 10:01

1 Answer 1

1

You should add jQuery reference before jQuery Mobile reference as JQM uses jQuery internally. In PhoneGap apps you should not add references from CDN as it reduces the load time of the app drastically.

If you rearrange your local references like this, your code will work.

<link rel="stylesheet" href="jquery.mobile-1.3.1.min.css" />
<script src="cordova-2.6.0.js"></script>
<script src="jquery-1.9.1.min.js"></script>
<script src="jquery.mobile-1.3.1.min.js"></script>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.