Defect #13811

Broken javascript in IE7 ; recurrence of #12195

Added by Adrian Wilkins over 4 years ago. Updated over 4 years ago.

Status:ClosedStart date:
Priority:HighDue date:
Assignee:-% Done:

0%

Category:UI
Target version:2.3.1
Resolution:Fixed Affected version:2.3.0

Description

This is a recurrence of #12195 caused by a stray comma in application.js (as detailed below).

In 'public/javascripts/application.js'


function observeAutocompleteField(fieldId, url, options) {
  $(document).ready(function() {
    $('#'+fieldId).autocomplete($.extend({
      source: url,
      minLength: 2,
      search: function(){$('#'+fieldId).addClass('ajax-loading');},
      response: function(){$('#'+fieldId).removeClass('ajax-loading');},
    }, options));                                                      ^ extra comma that IE 7 hates
    $('#'+fieldId).addClass('autocomplete');
  });
}

This breaks the subsequent loading of all other functions in application.js, which halts most Javascript execution because adding warnLeavingUnsavedMessage to the window.load event is the first thing every page does.

This class of problem is picked up by JSHint, which is available as a standard syntax check in my favoured web editor, Komodo Edit ; have taken liberty of patching away all it's complaints about

  • Semicolons
  • Commas
  • Comparison operators

.. attached to issue.

Have not done anything about other warnings ; the one that concerned me most was the warning about a fall-through in a case statement, but without a comment to the contrary and no familiarity with the code, cannot be sure this is not intentional.

application.js - Partially cleaned up application.js (from POV of JSHint) (16.3 KB) Adrian Wilkins, 2013-04-18 18:27


Related issues

Related to Redmine - Feature #10286: Auto-populate fields while creating a new user with LDAP Closed

Associated revisions

Revision 11728
Added by Toshi MARUYAMA over 4 years ago

fix JavaScript error on IE7 (#13811)

Contributed by Adrian Wilkins.

Revision 11729
Added by Toshi MARUYAMA over 4 years ago

use ===/!== instead of ==/!= in application.js (#13811)

Contributed by Adrian Wilkins.

Revision 11730
Added by Toshi MARUYAMA over 4 years ago

add missing ; at toggleCheckboxesBySelector of application.js (#13811)

Contributed by Adrian Wilkins.

Revision 11731
Added by Toshi MARUYAMA over 4 years ago

remove unneeded ; from warnLeavingUnsaved of application.js (#13811)

Contributed by Adrian Wilkins.

Revision 11732
Added by Toshi MARUYAMA over 4 years ago

fix ; position of if(){} at application.js (#13811)

Contributed by Adrian Wilkins.

Revision 11733
Added by Toshi MARUYAMA over 4 years ago

add missing ; in {} at application.js (#13811)

Contributed by Adrian Wilkins.

Revision 11734
Added by Toshi MARUYAMA over 4 years ago

Merged r11728, r11729, r11730, r11731, r11732 and r11733 from trunk to 2.3-stable (#13811)

History

#1 Updated by Toshi MARUYAMA over 4 years ago

  • Target version set to 2.3.1

#2 Updated by Toshi MARUYAMA over 4 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Committed in trunk and 2.3-stable, thanks.

Also available in: Atom PDF