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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Do
    • 3.5.0
    • None
    • 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

            Unassigned Unassigned
            jsoref Josh Soref
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: