apache / cordova-docs

Apache Cordova Documentation
https://cordova.apache.org/
Apache License 2.0
350 stars 554 forks source link

doc: Cordova JavaScript APIs (cordova.js) #852

Open eric-zeng opened 5 years ago

eric-zeng commented 5 years ago

Issue Type [ ] Bug [x] Feature Request

Priority [ ] Minor [x] Major [ ] Critical [ ] Blocker

Environment

Description It would be great if there was some text calling out that you need to include cordova.js and cordova-plugins.js in the main HTML file in order to get access to plugins and APIs, and that it makes the global cordova object available. The only indication that this needs to happen is that they're in the files produced by cordova create.

This caused some confusion for me, because I was integrating cordova into a web project, copied over my existing html file from the web side, and wasn't aware that those script tags needed to be in my file.

janpio commented 5 years ago

That's a good point, some explanation how it works would be quite useful.

Are you up to creating a PR for that? We can iterate on the text after a PR was created if you need some help.

eric-zeng commented 5 years ago

Sure! I'm on a tight deadline at the moment, but I will try to help when I have some more cycles.

erisu commented 11 months ago

I have updated the title to be more accurate to what is required.

The content of this request should not be in First App. The goal of first app goal is more like a quick start for running the Hello Cordova base app.

The content is more Reference material. Similar to the config.xml and plugin.xml page. This content will be added under the reference section.

Also the content of cordova-plugins.js is not necessary to document. The stuff is basically compiling the installed plugins. At most, a small statement saying this file should also be loaded for the plugin APIs to work. See plugin documentation for its JavaScript APIs.