IE sucks… and nothing to do coz. it’s windows default browser.
Hi this is my first post on JavaScript in my blog.. 🙂 I get a new error (JavaScript Error ‘expected identifier, string or number’ in IE) in JavaScript on IE when developing an application and got a solution on googling and post this here….
Sometimes we get this error and can’t seem to find a solution. It is worked on Firefox without no problem but on IE it throw an “expected identifier, string or number” error to the last line of the variable declaration. Take a look at the following codes that I was worked on..
1. $(“#scrollin_project”).carousel({
2. direction: “vertical”,
3. loop: true,
4. dispItems: 3,
5. autoSlide: true,
6. animSpeed: 1500,
7. nextBtn: ‘<input id=”btn_down” type=”button” value=”” />’,
8. prevBtn: ‘<input id=”btn_up” type=”button” value=”” />’,
9. });
In IE, the error was reporting “expected identifier, string or number” on the last line of my (above) codes. Look at the line number 8, there is a comma (,) at the end of the code. And IE catch this as an JavaScript Error.
And Here is the error free codes
1. $(“#scrollin_project”).carousel({
2. direction: “vertical”,
3. loop: true,
4. dispItems: 3,
5. autoSlide: true,
6. animSpeed: 1500,
7. nextBtn: ‘<input id=”btn_down” type=”button” value=”” />’,
8. prevBtn: ‘<input id=”btn_up” type=”button” value=”” />’
9. });
Now look at the end of the line number 8 of the above codes, it simple, I just delete the comma(,) and now there is no error on any browser.