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?
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.
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.
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.
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 }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With