minify - Javascript Closure Compiler Error Trailing Comma? -
when minifying javascript in handy tool google called closure compiler gives following error (and doesn't minify thing):
number of errors: 1 jsc_trailing_comma: parse error. ie8 (and below) parse trailing commas in array , object literals incorrectly. if targeting newer versions of js, set appropriate language_in option. @ line 389 character 1 in all.js
theme : 'default', // theme of slider (default, theme1, theme2, t...
where fault , needs changed fix error?
$(window).load(function(){ jquery('#slider1').autoslider({ theme : 'default', // theme of slider (default, theme1, theme2, theme3) width : '960', // width of slider, 100% auto full width, set 0 take width of largest image autohideplaybtn : true, //
the fault (for fear of rewording closure compiler error says) ie8 , below cannot parse object literals , array literals have trailing comma.
var obj = { a: 1, b: 2, // trailing comma bad! };
... vs...
var obj = { a: 1, b: 2 // no trailing comma! };
the fix remove trailing comma.
Comments
Post a Comment