Defect #13811
closedBroken javascript in IE7 ; recurrence of #12195
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.
Files
Related issues
Updated by Toshi MARUYAMA over 11 years ago
- Status changed from New to Closed
- Resolution set to Fixed
Committed in trunk and 2.3-stable, thanks.