Cordova: Device Ready Doesn't Show
I made a cordova project and device ready worked, I didn't get any errors. Then I tried to add two javascript files and a folder full of images. I have linked them in the index.ht
Solution 1:
In your main.js
file I can't find any deviceready
event handler.
Your app should wait this event before using any cordova function. You should wrap your app initializing function with a code like this:
document.addEventListener('deviceready', function () {
console.log("Start App");
// call your app init function
}
For a more clear example see the Cordova hello world app.
Does your js/index.js
contains this code? Check it.
Solution 2:
Solved it.. I renamed the project after I put all those files in, turns out you can't do this. I changed the name back to what it was before and now it works!
Post a Comment for "Cordova: Device Ready Doesn't Show"