Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-7973

js/index.js is TL;DR and obscures the key point

VotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Do
    • Affects Version/s: 3.5.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jsoref Josh Soref

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment