Cordova 2.4.0 and up supports AMD for loading into javascript. I am specifically looking to use Cordova 2.5.0 with the latest version of RequireJS, backbone, jquery, jquery mob
To use the lazy loading, one option is to use the domReady plugin from requireJS (cf. http://requirejs.org/docs/api.html#pageload).
Once requireJS has confirmed that the DOM was ready, you can then wait for the device to be ready using the regular deviceready listener.
require(['require/domReady','cordova/cordova-ios-2.5.0'], function (domReady) {
domReady(function () {
console.log("The DOM is ready - waiting for the device");
document.addEventListener("deviceready", startWhenReady, false);
}
});
function startWhenReady()
{
console.log("dom and device ready : we can start...");
// your app
}
Worked for me!