170
rated 0 times
[
174]
[
4]
/ answers: 1 / hits: 22343
/ 12 Years ago, fri, november 2, 2012, 12:00:00
I am building a PhoneGap App. Unfortunately, when deploying to iOS devices and simulators the deviceready
event never fires. I'm using Phonegap 2.2.0.
When I deploy the same code to Android (using the Android-specific cordova.js
file of course) the App will work perfectly.
When I replace the deviceready
with a jQuery-ready()
the app will load on iOS as well, yet it will then lack access to the device specific APIs.
The cordova.js
is loaded as I will see a simple alert message that I put inside of it, yet deviceready
never fires and the APIs are never exposed.
My HTMLs head
:
<script type=text/javascript charset=utf-8 src=js/cordova.js></script> <!-- yes it is the iOS version -->
<script src=js/jquery-1.8.2.min.js></script>
<script src=js/app.js></script>
My JS:
function doStuff(){
//app functionality
}
document.addEventListener('deviceready', doStuff, false);
But somehow stuff will only get done on Android...
More From » jquery