Search code examples
cordovacordova-pluginscordova-3

How to create Cordova project?


I created a JS / HTML Cordova project with command

$ create cordova example

Then I saw the code below in the file example/www/js/index.js:

enter image description here

but in this picture of cordova/events website:

enter image description here

I saw another code in training that differed from my js. I copied this js code to instead of my index.js, but did not get any results.

Why is there a difference between my code and website cordova?


Solution

  • when create cordova project as blank, some code will be generated automatically like you mentioned.

    create cordova example
    

    cordova/events website's code is another example. you should use one of them, can't use both at the same time because somethings are same function.