I am using phonegap 2.9.0 in Phonegap Build, and testing on my Android device.
I am not sure how to register Phonegap and Jquery Mobile events, so I added the following code (found here Correct event registration in the 'PhoneGap + jQuery Mobile' application) at the top of my boarddo.js file ... and nothing happens, everything is locked at the splash page :
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() {
console.log('both frameworks are loaded');
alert('both frameworks are loaded');
//....NOTHING POPS UP !!
}
//then I do my things :
$(document).on('pageinit','#splash-page', function(){
//...
});
function checkConnection() {
//...
}
$(document).on('pagebeforecreate', '#welcome-page', function(){
//...
});
$(document).on('pageinit','#welcome-page', function(){
//...
});
I am confused about how to register events for Phonegap + Jquery mobile apps as I have seen different opinions everywhere.
In my index.html, is the call to the js files in the correct order ? :
<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery.mobile.config.js"></script>
<script src="js/jquery.mobile-1.3.2.js"></script>
<script src="js/jquery-geturlvar.js"></script>
<script src="js/functions.js"></script>
<script src="js/boarddo.js"></script>