Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Correct way of using JQuery-Mobile/Phonegap together?

What is the correct way (to this date) to use JQuery Mobile and Phonegap together?

Both frameworks need to load before they can be used. How can I be sure that both are loaded before I can use them?

like image 211
Juw Avatar asked Jun 08 '12 08:06

Juw


People also ask

Where should you place the jQuery Mobile js file?

jquery-mobile Getting started with jquery-mobile Setup Create a library (or lib) folder inside of your application (inside the www folder). Create a jquery-mobile folder inside the lib folder (I've named mine jqm). Place all of the jquery-mobile files that you have extracted inside of the jquery-mobile folder.

Is jQuery and jQuery Mobile the same?

jQuery and jQueryUI are both designed to be added to your website if you want to add a particular feature, jQuery or jQueryUI might be able to help. However, jQuery Mobile is a full framework which is built on jQuery and jQuery UI foundation.

Do people still use jQuery Mobile?

The deprecation of jQuery mobile follows the careful transition of another project under the jQuery project umbrella, jQuery UI. jQuery Core is still actively maintained and widely implemented.


1 Answers

You can use deferred feature of JQuery.

var deviceReadyDeferred = $.Deferred(); var jqmReadyDeferred = $.Deferred();  document.addEventListener("deviceReady", deviceReady, false);  function deviceReady() {   deviceReadyDeferred.resolve(); }  $(document).one("mobileinit", function () {   jqmReadyDeferred.resolve(); });  $.when(deviceReadyDeferred, jqmReadyDeferred).then(doWhenBothFrameworksLoaded);  function doWhenBothFrameworksLoaded() {   // TBD } 
like image 63
Octavian Avatar answered Sep 20 '22 03:09

Octavian