user3262344
user3262344

Reputation: 125

phonegap event that fires only once per app load?

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

Answers (2)

Subjective Effect
Subjective Effect

Reputation: 1465

Run deviceready only once.

On your other pages use documentready.

Upvotes: 0

AtanuCSE
AtanuCSE

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

Related Questions