JavaScript Error ‘expected identifier, string or number’ in IE
15 Dec 2010 Leave a Comment
in JavaScript
I just can’t resist myself to blog this, as this is one of the most annoying error I found in IE. When I was testing a Jquery Code I’m writing, Firefox worked without a hitch, but IE threw an ‘expected identifier, string or number’ error pointing to the last line of the variable declaration.
Here is the code:
var main_api = $(“div.main_scrollable”).scrollable({
mousewheel: false,
api: true,
speed: 400,
prev: “.main_prev”,
next: “.main_next”,
clickable: “true”,
});
Look at clickable: “true”, notice the comma after. That’s what was causing the the error. I had taken out a variable under that one but forgot to remove the comma. FireFox ignored the error, but not IE. One little misplaced character, so much wasted time. Arrrrrggg….IE!!!