Mohd
Mohd

Reputation: 321

Referencing cordova.js on html pages

I have a multipage html5 app using PhoneGap. I was told to only reference cordova.js on the index.html page (the first html file that is loaded) however, if I try using the device camera on any page other than index.html, it won't work unless I also reference cordova.js on that html page.

Can someone clarify whether it is ok to reference cordova.js on all the html pages of my html5 app?

The reason I'm concerned about referencing it more than once, is if I do, then I get errors on firebug about referencing it more than once and although it doesn't affect the app at all, I'm avoiding doing so.

Upvotes: 1

Views: 600

Answers (2)

Suhas Gosavi
Suhas Gosavi

Reputation: 2170

Any page that uses Cordova must include the cordova-*.js file for the associated Cordova version and platform.

Refer Include Cordova section in above Phonegap Document.

Upvotes: 1

hkazemi
hkazemi

Reputation: 708

You have to reference cordova.js on very page, It's part of the cordova framework that works in pair with native code for the devices.

Upvotes: 0

Related Questions