// In my index.html, in a script tag
var deviceReadyDeferred = $.Deferred();
var jqmReadyDeferred    = $.Deferred();

$(document).one('deviceready', function() { deviceReadyDeferred.resolve() });
$(document).one("mobileinit",  function() { jqmReadyDeferred.resolve() });

$.when(deviceReadyDeferred, jqmReadyDeferred).then(app.initialize);

// In a app.js file
var app = {
	initialize: function() {
        console.log('Init');
    }
}