Here is the standard way of loading and detecting Cordova & JqueryMobile framework. /* @author Abhishek Kumar @email akbittu@gmail.com */ var app = { deviceReadyDeferred, jqmReadyDeferred, initialize: function() { this.deviceReadyDeferred = $.Deferred(); this.jqmReadyDeferred = $.Deferred(); this.bindEvents(); }, bindEvents: function() { document.addEventListener('deviceready', this.onDeviceReady, false); $(document).one("mobileinit", this.onJQMReady); $.when(this.deviceReadyDeferred, this.jqmReadyDeferred).then(this.onCompleteReady); }, onDeviceReady: function() { app.deviceReadyDeferred.resolve(); }, onJQMReady: function() { app.jqmReadyDeferred.resolve(); }, onCompleteReady: function() { main(); } };
Possible solutions of Impossible problem. Out-of-the-box Ideas. Amazing notes. Unbelievable facts. Simple & easy to follow tips and procedures.