Why does cordova.exec () run before "deviceready" in Android PhoneGap (1.7)?

I am trying the "PhoneGap" (1.7.0) jQuery Mobile application (1.1.0). I need to create an android app. However, I continue to receive the following warning message.

ERROR: Attempting to call cordova.exec() before 'deviceready'. Ignoring.

It looks like this might happen during calls to $ .ajax, but it's hard to do.

I do not call Cordoba functions in my application - this is pure JQM.

Any ideas what the problem is. Or, otherwise, does anyone know why cordova.exec () can be called during a $ .ajax request?

I am running an application under Android 4.0.3 in a virtual device / simulator.

+5
source share
2 answers

, , , cordova-1.7.0.js( phonegap-1.7.0.js ) iOS, iOS JS Android, .

-1.7.0.js , JS .

+21

,

$(document).ready()...

, javascript

<body onload="init();">

html

function init(){ 
     document.addEventListener("deviceready", onDeviceReady, true);
}

javascript,

0

All Articles