Reputation: 125
i have a multi-page phonegap app
document.addEventListener("deviceready", yourCallbackFunction, false);
is good per page.
But i am asking for the entire app... is there any event that is fired only when the app loads and not the page loads??
Upvotes: 0
Views: 544
Reputation: 1465
Run deviceready only once.
On your other pages use documentready.
Upvotes: 0
Reputation: 8940
So far I know there isn't any good way or direct way. If you need it badly you'll require a hack.
After the startup of your app there is a landing page, right!! like index.html
.
In that page put a deviceready
event. Do whatever you want to on the app start-up. And then redirect to your main first page say firstpage.html. Don't link back to index.html anymore during app use. Hackish.
Upvotes: 1