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
:
but in this picture of cordova/events website:
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?
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.