Defect #13811
Broken javascript in IE7 ; recurrence of #12195
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | High | Due 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.
Related issues
Associated revisions
fix JavaScript error on IE7 (#13811)
Contributed by Adrian Wilkins.
use ===/!== instead of ==/!= in application.js (#13811)
Contributed by Adrian Wilkins.
add missing ; at toggleCheckboxesBySelector of application.js (#13811)
Contributed by Adrian Wilkins.
remove unneeded ; from warnLeavingUnsaved of application.js (#13811)
Contributed by Adrian Wilkins.
fix ; position of if(){} at application.js (#13811)
Contributed by Adrian Wilkins.
add missing ; in {} at application.js (#13811)
Contributed by Adrian Wilkins.
History
#1
Updated by Toshi MARUYAMA almost 8 years ago
- Target version set to 2.3.1
#2
Updated by Toshi MARUYAMA almost 8 years ago
- Status changed from New to Closed
- Resolution set to Fixed
Committed in trunk and 2.3-stable, thanks.