Josh Soref created CB-7973:
------------------------------
Summary: js/index.js is TL;DR and obscures the key point
Key: CB-7973
URL: https://issues.apache.org/jira/browse/CB-7973
Project: Apache Cordova
Issue Type: Bug
Components: App Hello World
Affects Versions: 3.5.0
Reporter: Josh Soref
Today, on #cordova, we had a user acknowledge that they looked over
js/index.js, didn't understand that it was doing anything important, and
replaced it.
Unfortunately, in doing this, they removed
document.addEventListener('deviceready', ..., false);
Which is really the only important part of the code.
Object Oriented Code is nice for reuse, but it's awful for samples where people
aren't going to use your code and won't be able to tease out what's important,
and what's just app-specific.
A number of suggestions were given.
* highlight jQuery equivalence (jQuery(...).ready() ?))
* drop OOP
I toyed with the idea of including a link to the documentation on deviceready
with a comment explaining that you can't use any cordova stuff before it has
been called.
But, I'm just opening this bug to track the issue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]