Invoice software |
For below javascript code, i got error "Expected identifier, string or number" in IE but it's working fine in firefox and safari.
var RealtimeViewer =
{
timer : 5000,
Interval : null,
init: function() {
xxxxxxxxx
xxxxxxxxx
},
RatingUpdate: function(){
xxxxxxxx
xxxxxxxx
},
};
To solve the problem, remove the last "," before close the object RealtimeViewer "};". It will become
var RealtimeViewer = {
timer : 5000,
Interval : null,
init: function()
{
xxxxxxxxx
xxxxxxxxx
},
RatingUpdate: function()
{
xxxxxxxx
xxxxxxxx
}
};
59 comments:
mate... you just solved a problem I'd spent two days working on. Champ!
Same here!!
I think it's dumb that IE assumes a new string just because you had a comma, but THANK YOU for sharing the solution!!
Dang... I can't believe it consumed me... and it was so simple!! GAHH :|
Thank You. Thank You. Thank You.
lol, that was so simple, hahaha
thank you! luckily for me (and others, it appears), this entry is the first hit on google when you search "expected identifier string number"
thanks again
Thanks , that was a great help.
Thank you so much, you just saved me hours of pain.
Thanks so much! You just saved me hours of debugging.
Wow... first result on google and my problem is solved (even though its unrelated, it was that stupid comma)
thanks heaps :)
Im getting same error in prototype.js but didnt get "," before closing last }. Do you have any idea about that.
Hi Amit, can post ur code to me? thanks
Hi blue,
I have solved that problem. Problem was not with prototype.js but with another js file.
Thanks
Another mind brought back from the edge of IE-induced insanity. Thank you!
Thank you. It helped a lot. While trying to debug the problem, i never did even had a hint that it would be because of a this :-s
THANK YOU!
thank you!!! :) stupid internet explorer is driving me crazy!!! thank you again for sharing this extremely quick fix!
Nice thanks a lot firstr search in google and its solved , sounds amazing
saved me, man
Man, youre the king!
This weird messege is also caused by an ending comma in an json feed!
Behold my brothers and sisters.
http://www.jslint.com/
Never again will you suffer at the hands of such a simple mistake.
Great Catch! Also I notice that using reserved words as method names will produce the same error (at least when constructing classes in mootools). So for example...
var MyClass = new Class({
delete: function(){
//code
}
})
Thanks for posting the fix.
thanks a lot....
simple and effective solution..
Thanks man... lifesaver!
Now if only I could get jwplayer to work in IE.
I feel so stupid but thank you so much - if only I had thought to remove the last comma 2 hours ago!
Tanks mate! I will now be able to brag with my error free site!
Thanks a lot! This saved me lots of frustration!
Nice simple solution - hard part for me is finding where the stupid error comes from in the first place! The IE dialog box tells the line number and character position but remember this is the line relative to the JS file being executed.
Well, you didn't save the the "hours of pain," but I'll still give you the thanks!
OMFG, if IE just specified which GD file it thought the error was in, I'd be gulping cervezas by now. Ugh.
God I hate trying to write JS for IE. You're my hero
Thanks for this explanation, it saved me some time!
Claudio
Worked a treat!
Please don't ever take down this post! You saved the last shreds of my sanity :)
Stupid IE. I don't even care that it caused an error in the lame-@ss browser... why can't they provide an error message that actually means something?!?!?!
Thanks again!
you saved the day.. Thanx!!!!
I just ran into this myself, and your post was exceedingly helpful. Thanks!
Thank God this is the first entry on Google! and thank God you put up this post :)
ty, i was freaked out when it didn't work in ie and glad when it turned out to be such a simple fix.
Thank you for the fix. Googled the IE error and BLAME!
Can't thank you enough.
Thank you. Thank you.
much obliged.
2 years after posting this article, its still helping people out.
Thanks for the info - and for potentially saving me hours of debugging (which with IE is like p*ssing in the dark).
Thank you...
Its a simple problem, but solution is not so obvious. ;)
Thanks this really helped out.
brilliant!
i cannot thank you enough!
Thanks a lot for sharing this. That saved me a lot!
Isaac
Thank You! Thank You! I already hate IE, but you saved me from cursing it even more.
DAAAANG. I can't believe that was it.
Thank you for sharing this.
Now i'm no IE fan...and gawd knows I love bashing it, but if there are no more params then the last , is not needed, and is in fact wrong!
IE 6 rage alert... hehehe
Thanx for the heads up! Pointed me right at the b@stard extra comma!
thanks very very useful
THANK YOU!! I spent *hours* trying to figure out why IE was throwing this exact error in a jQuery statement. It turns out the cause is the same, although in this particular case it was in an ajax list of key/value pairs. The last key/value pair ended with an extra comma. Removing it was the fix. Thanks again for posting this!
Thanks!! Would have never figured this out on my own. It's always IE, even with IE 6 phasing out, it's still always IE!!
THANK YOU!
What ever would we do without Google… and the good souls who post their solutions for the rest of us. I hadn't yet spent hours trying to figure this out, but I'm sure I would have. Many thanks!!
Another "thanks"!
BTW if anyone else has this problem while trying to configure CKEDITOR (I've been pulling my hair :-)
As of 1/13/2011 the online document at http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html has a long list of example config statements, and many do not enclose the reserved word class in apostrophes, which results in this SAME ERROR MESSAGE. So if you copy from that documentation, you need to update the code to 'class' (see comment from Hans on Feb 09 in this forum.)
Saved my butt thank you!
If anyone is configuring JWPlayer and is using the Google Analytics Plugin - beware if it is the last line:
plugins: { gapro: { accountid: 'UA-202715-21' } },
Which should be of course:
plugins: { gapro: { accountid: 'UA-202715-21' } }
Crazy thing is that it works fine in FireFox, Safari, IE9 ... but not IE8 so it took me a while to catch.
How do they manage to do this STILL at Microsoft?
Thanks soooo much for posting this.
thanks Gabrielle, for sharing your experience here.
thanksss........
Super dooper dooper... Man why did they even build an IE. Please ask the microsoft guys to just buy of firefox and stop creating IE browsers any more...
This is insane. Who puts extra comma before ending a bracket? "}"
there must be something wrong with firefox and safari that do not have problem with that.
{a,b, c,} is a syntax error.
looks like this is a page of dummies :)
Post a Comment