JavaScript Error 'expected identifier, string or number' in IE

Sometimes you get those errors that just pick at you and you can't seem to find a solution. It happened to me this morning when testing a JavaScript library I'm writing in IE7. FireFox worked without a hitch, but IE threw an 'expected identifier, string or number' error pointing to the last line of the variable declaration. Of course it didn't help that my copy of MS Script Debugger wanted to lock up my computer.

Here's a very shortened example of the code I was working on.

var variableName =
	function1: 		function()
		//	Do something
	function2: 		function()
		//	Do something else
	variable1:		'Some value',
	variable2:		'Another value',

The error was reporting a problem on line 13. So after hacking my way around trying to figure out why it was giving me this error, I went out Googling. About 10 pages into the search results I found the solution.

Look at line 12. See the comma after 'Another value'? That's what was causing 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. Hopefully y'all will spend less time finding the fix than I did.

Quick edit, thanks to Pete in the comments. Looks like using a reserved word will also cause the same error in some versions of Internet Explorer.

Tagged , , , , , , ,

293 thoughts on “JavaScript Error 'expected identifier, string or number' in IE

  1. kchr says:

    Thanks for the heads-up.

    I stumbled upon the exact same problem this morning and fixed it rather quickly thanks to your post. I knew I would've spent countless of hours on troubleshooting this in IE as Firefox is way more forgiving on semantic errors like this.

    On a related note I'd like to mention JSLint, which is an excellent tool for validating JS code.

    Thanks again!

  2. Ryan says:

    JSLint does look to be a pretty slick tool, although I didn't try it. The only thing that could make it better is if you could upload an entire file rather than just cutting and pasting.

  3. Kristof says:

    Thank you, I have wasted an hour searching for an explanation. Damn you Internet Explorer!

  4. Ryan says:

    Kristof - Sounds like you and I were in about the same place. I'm sure it was at least an hour that I spent looking for a solution to what turned out to be such a simple issue.

  5. Yao says:

    Thank you so much! Ran into the exact problem myself and you just saved me hours of debugging!

  6. Tim Gurske says:

    You're a lifesaver man!!!

  7. Luca Ferroni says:

    Thank you very much and thanks to kchr: JSLint is really simplifing my life !

  8. helen says:

    thank you!

  9. Phoebe says:

    Thank you, thank you, thank you - only wasted 30 mins on this then I found your tip!

  10. Alborz says:

    I am also having this error, but its just caused by loading the site normally... can't seem to work it out :(

    IE says Line 2 Char 6999 - which doesnt exist

    and the error only started occurring when we moved from one server to another.. any ideas?

  11. Chris says:

    I've had the same cause many times, but this is the first time I've seen this error message.

    You may have been searching to page 10, but now you're #1 for

    ie javascript error "expected identifier string or number"

    Many thanks!!!

  12. hari says:


    It helped me and i was able to solve imm.


  13. Thomas says:

    Thanks! Had the exact same problem - this post saved me a lot of trouble!

  14. Sidney says:

    Wow, Thanks I was dead in the water on this one. If you hadn't taken the time to put up this post, myself and all the posters above would be stuffed.

  15. Mona says:

    Thanks for sharing for sharing. JSLint worked like a charm

  16. JuanG says:

    Saludos, Yo tengo un codigo distinto (donde no veo comas) pero que me da el mismo error: "se esperaba un identificador, una cadena o un numero". No he podido ubicar el problema y quisiera tratar de ubicar mi solucion a traves de tu ejemplo.

    Mi codigo (por si acaso ayuda) es el siguiente:

    [CODE]function moreFields() {
    for(i = 0; ; i++) {
    var state = document.getElementById('tr-'+i).style.display;
    if (state == 'none') {
    document.getElementById('tr-'+i).style.display = '';

    Crees que podrias ayudarme a identificar lo que no permite que funcione en IE?

    Gracias de antemano por tu tiempo y ayuda.


  17. alvaro says:

    thanks from chile!

  18. Ajay says:

    I just can say, you saved my life... because of , comma

  19. Danielle says:

    Saved me alot of trouble, thanks :)

  20. Ryan says:


    I've spent the last 3hours looking for a fix and this was exactly what I needed!

  21. sonam says:

    thanx a lots.............

  22. Amit Sidhpura says:

    Hey thanks man...Keep posting such things it helps people save lot of time...Thanks again...

  23. Ross says:

    Thanks for that, had the error come up in IE, sorted it out after reading your tip :D


  24. D Barnes says:

    Thank you SO MUCH for posting this! I was going NUTS trying to figure out what was wrong!

  25. vlad says:

    Confirmed on IE6/WinXp sp2 clean install.

    Works like a charm! Great input, thanks.

    So everyone, write clean code or IE will destroy you.
    (that's a bit ironic isn't it?)

  26. pia says:

    Thanks a lot. I was going mad or at least, depressed: my code worked just fine in Safari, Opera and Firefox, but IE always is the pain in the ass... innit?

  27. Max says:

    Thank you so much for this. I had the exact same problem.

  28. bak says:

    Thanks a million, this saved me a ton of time! Heh, IE ftl once again... This site wins! Thanks!!

  29. cmoslim says:

    Wow thanks a billion, bloody hell IE annoys the crap out of me sometimes, had it not been for your post I would have wasted half a day's work trying to pinpoint what was throwing me off.

  30. Tarkh says:

    ahhh, Crapy IE!!!...
    Thanks for that, man! You rulezZZ!

  31. vinu says:

    ooh great..thank you very much.thaks a lot

  32. PunDit says:

    Awesome. I was going nuts until I found this....

  33. Sam says:

    Thank you for this! saved a lot of time for me as well :)

  34. Sam says:

    I forgot to mention.. while in IE8, working locally, the extra comma was ignored and no error was thrown. It was when I published my page the error was thrown for me.

  35. Sam says:

    Last reply I swear.. (in response to my last reply)

    I realized why it had worked locally and not after I published. While using IE8, on the tab with my local version opened it was in Browser Mode: IE8 Compat View / Doc Mode: IE8 Standards. On the tab with the live published version opened it was in Browser Mode: IE8 Compat View / Doc Mode: IE7 Standards.

    alright I'm done.

  36. zebelak says:


  37. Ryan says:

    @Sam - No worries. I'm the same way. As soon as I hit submit I think of something else to say.

  38. Ryan says:

    You know what's sad? Googling for an IE7 specific JavaScript issue and having your own webpage come up :) Got this error today and forgot that I had made this post, but Google helped me remember.

  39. Arzt says:

    I forgot to mention.. while in IE8, working locally, the extra comma was ignored and no error was thrown. It was when I published my page the error was thrown for me....

  40. gib says:

    thanks a lot, first page i found when looking at the same problem!

  41. silky says:

    Thanks a lot man... you are superb...

  42. pravin says:

    Thanks a lot man...Saw the extra comma...But dint realise that was causing the issue..

  43. Lukas says:

    Great dude, you saved my life.

    Thank you, thank you, thank you!!!

  44. I'll note that IE will issue this error any time it can't parse a javascript literal, and the parsing fails when it's trying to read a key. So it will issue this same error for:

    var dict = {{a:1, b:2}};

    and for

    var dict = {-a:1, b:2};

    in addition to for the extra comma.

    Although other browsers would also choke on these errors, IE parses javascript a bit more aggressively than other browsers, so for example if you add a whole tree of html elements by setting innerHTML on a containing DIV, and some of the new elements you create have "onClick" attributes with javascript errors in them, IE will notice and complain right away. Firefox won't notice until someone clicks and so activates the bad javascript. This means IE will throw up this error even if it's something you don't necessarily see in other browsers.

    Also, a trailing comma is a problem in IE in arrays too, not just in dictionaries. In arrays the behavior isn't a parse error though: you end up with a trailing addition to the array that's "undefined". (whereas Firefox, Safari, Chrome, etc., simply have one fewer element than IE)

  45. Corey says:

    You just saved me a lot of work. A 'gotcha' to remember for next time. Thanks!

  46. Thanks for sharing this information . i wasted 2 hours for this issue. now it fixed thanks lot

  47. Sarvesh says:

    Thanks a lot.Its very useful.

  48. Many thanks for this! Saved me hours I'm sure.

  49. Iman says:

    Thank you,really helped ,FF may ignore error in java script which ie didn't ignore..learned lessons :)

  50. Eyemaster says:

    Many thx 4 this dude! U are the man!

  51. Thanks man, you saved my day!
    After 1h of JS debugging and googling I slipped over your article and now I'm all clear in IE7 again. I surely learned a lesson as well today... ;)


  52. husain says:

    Thanks man it saved my day.

    your explanantion is correct and to the point ..

    Thanks thanks thanks


  53. vinh says:

    You are my day saver .
    Huge Thanks

  54. vinh says:

    And by the way, I tracked the error by using firefox, It is a warning in firefox but It pointed out where is the problem, fix it and marvelous.

  55. Antonio says:

    I stumbled across this same problem. It's amazing what a comma can do.

  56. Dinesh says:

    Thanks heaps for your thoughtful post that saved me hours of wasted time.

  57. Jörg Ramb says:

    I would not say it's an error actually, I think it is allowed to have a trailing comma! Makes live so much easier. But thanks to IE7 not any more...

    Thanks for sharing!

  58. Graeme Lewis says:

    One of the very few times I have done a Google and found the exact answer first time. AND!!!! described in a way that mere mortals can understand.

    Granted we should do things right and according to the coding standards...but which one!!

    Thanks for sharing! My brain thanks you a lot!

  59. Devin Walker says:

    Thanks a lot! Helped me solve my problem with IE7

  60. Harry says:

    Thankyou so much for taking the time to post this. I don't know what I would have done if i hadn't found this page.

  61. Brayne says:

    Thanks for the time spent on this.... you saved me hours from my OCD in programming.

  62. Alex says:

    what the hack, IE always does the stupidest things puzzling developers like us

  63. pritisolanki says:

    Thank you so much !!

    This was in real life saver !!

  64. Thanks, this was a life saver.

  65. Martin says:

    You are a life saver, thinking of sending Microsoft an invoice for unnecessary time wasting. Or file a law suite of incompetence.

  66. Juanes says:

    Thank you very much, I had lost many time searching for the ansr!!!

  67. Josh says:

    THANK YOU! I spent 2 hours trying to figure out what was going wrong and I found your post. What a life saver.

  68. Ben says:

    thanks man saved me a lot of time. I f**king hate IE with a passion

  69. Benja says:

    Thanks a lot. You saved my code.

  70. jlfenaux says:

    Thanks a lot. You saved my day ;-)

  71. Shane says:

    Thanks! Saved me lots of trouble!

  72. kj says:

    what a star!!!!!

  73. doug says:

    thanks for fixing this thing. there is however some of us out here that needs a geek to hold our hand. what is the actual step by step procedure to actually fix this thing?
    many thanks

  74. Paul S says:

    Thanks AGAIN!!! haha a while ago I had this puzzling error and stumbled upon this site, then today again and again Google got me here! To actually find the trailing comma is easy if you use, the error you'll be looking for is something like this:

    Problem at line 4 character 500: Extra comma.

  75. Ryan says:

    You think it's bad that you came to this page twice. I've come to this page through Google looking for the cause of the "expected identifier", and I wrote the post.

  76. Jonathon says:

    Ryan - I'm glad to see you're still checking comments. This just saved me a potentially significant amount of frustration. ;) Thanks for posting!

  77. webbuilder says:

    Thank you so much!! I just ran into this very problem on a website I'm building and was almost tearing my hair out!!

    thanks for sharing, now I can sleep well!!

  78. Patrick says:

    Thanks for this :)

  79. Tim says:

    Thanks man,

    you rule


  80. Amy says:

    I am having this same problem with IE, it says "Error on page" @ the bottom of the page, when i click it, this wondow pops up it shows:
    Line: 34
    Char: 6137
    Error: Expected Identifier
    Code: 0

    Now what am i supposed to do? Need help to fix this problem asap please :) it would be greatly appreciated.

  81. yasar says:

    I had the same problem and your post helped me fix it within 2 mins instead of trying and working around the problem for hours. Thank you very much. :)

  82. sonam says:


    i knew this solution but again i did mistake and found this particular page.. Great work Done!!!!

  83. Alex Forster says:

    You saved me from spending another hour trying to figure out what the hell was going on. Thank you very much.

  84. Keith says:

    Thanks for sharing this tip! Your help made this a 1 minute fix instead of a major debug ordeal!

  85. Sarah says:

    Thanks very much for sharing. I have IE had have, in the past, spent ages trying to find fixes. In one search and a few seconds later, script executing perfectly.

    Thanks for saving me a huge post-weekend headache.

  86. malificent says:

    ah, thanks! that helped! weird that it doesn't break chrome or firefox...

  87. Rob says:

    THANK YOU! Something so bloody obvious but that I'd not spotted after spending hours checking over the code :-)

  88. knight42 says:

    THANK YOU! Saved me a while of pointless panicking!

  89. Eric Marden says:

    I could kiss you! (I won't, but I totally would!)

  90. Kevin says:

    I had this error today and i found another case that triggers it, not the same cause as above.

    value = ({default: {textAlign: 'center'}});

    this code triggers it in IE but its fine in firefox. aparently ie doesnt like the formating without single quotes.

    changing it to:
    value = ({'default': {'textAlign': 'center'}});

    fixes it.

  91. Kelly says:

    Excellent, this was exactly the problem I was having. Thanks!

  92. Storm says:

    Thanks so much for this fix, I would have been looking for hours if it hadn't been for you :)

  93. Jules César says:

    Thanks buddy, u save me :)

  94. Alexander says:

    Thank you so much for that hint. I ran into this problem while loading a secound page into a div via prototype.js. The Ajax.updater was not able to eval the returned script.

  95. Gus Gus says:

    Thank's alot mate!!!!

  96. Thanks man. That post saved me a lot of time.

    I was trying to figure what was causing my site to crash from a while now.


  97. Thank you very much for this. I'm not sure how long it would have taken me to figure this out, but your post made it a two-minute problem.


  98. Joe Czucha says:

    Excellent post, I had a rogue comma as suspected.

    Thanks again :)

  99. Jason says:

    DUDE. thanks.

  100. Pekka says:

    Yes! Thank you for saving a lot of time. :)

  101. travis says:

    Thank you for saving me time!

  102. MarkHebs says:

    Yes! Thanks very much too ... this was VERY helpful . I also had a rouge comma causing my JavaScript to fail in IE7.

  103. Teo says:

    It's not an error!!! That little coma it's suppose to be good practice! God knows what reason have the ie7 guys to implement javascript that way. Also, crappy-crappy program alert.

    Thank you very much my friend!!!

  104. Teezi says:

    Props! Thank you for your useful tip. IE has wasted many hours of my life. MS needs to get with the program. Can I get an amen...

  105. ramses martinez says:

    Thanks a lot buddy, you save me a huge waste of time :D

  106. valerio says:

    you're my sunshine my only sunshine!
    Can have a beer for that.
    Fixed on galleriffic after a day spent to try and to try...

  107. Ben says:

    This post saved me hours! Thanks for posting it.

  108. Brad says:

    I had the same problem, google it and found your blog. Went through my script and sure enough there was and extra ",". Thank for sharing!

  109. Yash says:

    Thanks alot got resolved...

  110. Jerry says:

    Thank you very much! I try to find the error where is, but I failed, so your solution help me. I made a test, the error only in IE6/7, not in IE8...

  111. Taz says:

    Dude....THANKS for that. you. I'm glad ur sitting on Number one for my Google search... that error had the potential to ruib my whole day.

  112. Justn Cribb says:

    Thank you very much! I'm happy you shared how you were able to solve this problem! More power to you!

  113. Jerry says:

    WTG dude!

    I've been spending hours looking for solution for this issue in IE7.
    IE8 ignores the extra comma as well.

  114. terceiro says:

    hi, your post just saved hours of debuggin with this shit microsoft calls a browser. Thank you!

  115. Morgan says:

    An absolute lifesaver. You now come up as the first result on Google for the search "expected identifier string or number", so thank you for saving us from having to look through 10 pages (or even 2/10 of one).

  116. Keir Lavelle says:

    This saved me alot of grief, I designed my site using IE8, FF Safari and Chrome and everything worked fine, but when I tested in IE compatability view it all went to pieces, but thanks to your post the problem was sorted in 10minutes instead of hours so a big thumbs up!

  117. Jatin says:

    Thanks dear your solution saves lots of my time and I really appreciate you. good job and thank you very much.

  118. Zif says:

    Many Thanks

  119. Rodrigo says:

    Hi, Thanks a lot you save my day!

  120. Ralph Harrer says:

    Thanks for that great hint! You just helped me saving a lot of time.

  121. Ofer says:

    Thanks you thank you thank you thank you!!

    I had this error in my Jquery scrollable which made it
    not work on IE7. Thank you for saving me the whole day
    looking for a solution!

  122. Kunal says:

    thanks to you and thanks to google that lead me to the perfect solution to my problem...cheers!!

  123. Carla says:

    Okay, that's great, but I'm not a techie so I have no idea how to get to where you're talking about to "fix" this problem.... Anybody willing to help me out......and I mean HELP.....hand-in-hand, step-by-step....

  124. Ryan says:

    @Carla - You're getting this error in a .js file somewhere. The message in IE should point you to the file and at least a line near the problem. The very last line should not have a comma at the end.

  125. rj says:

    wow. you are awesome for posting this.

  126. Thanks for this post. Its really works. And I was little bit irritated when I got this error message. But now its fixed. Really thanks for this post. :)

  127. sarita says:

    Thanks a lot for this..... :)

  128. Uneeb says:

    Nice! Thank you for sharing.

    IE sucks big time! :(

  129. Steve says:

    Thanks! Saved me a ton of time.

  130. Catherine says:

    thank you, man!

  131. Chung says:

    ahhh, thanks for saving me a lot of time regarding this problem.

  132. NickB says:

    You're a legend. Stupid error, stupid browser. Slightly sloppy coding too ;)

  133. Andrea says:

    Thanks man! ;)
    IE7 sucks!

  134. ihaskin says:

    First Google result, and your explanation was EXACTLY what has been driving me bonkers.

    A hint:

    I was using php-includes, so when I looked for the line number that the error was referring to, nothing lined up --> load the page in IE and then view the entire source of the page. Copy and paste into a text editor that shows line numbers (or count them).

  135. Nandish says:

    Thanks a lot. I had implemented a rather complicated JQuery based grid which was working fine with Firefox and Chrome. It was IE that threw an exact error. Thanks to this post, I solved my problem.

  136. Ran Bar-Zik says:

    Thank you very much for sharing this! It saved me a lot of time and trouble!

  137. nikkitousen says:

    You saved my life, I was having the same problem.

    Thanks a lot!

    P.D.: Die IE, die!

  138. Matt says:


    I had the same problem and it was driving me crazy.

  139. Trishul says:

    Thanks a lot.
    its very useful for me.
    you are great!!!!!!!!!!!!!!!!!!!!!!

  140. Raman says:

    you saved my life Too !

    Thanx a ton for posting this .

  141. Kevin says:

    I owe you a beer.

  142. langtu0780 says:

    Thank you very much for sharing this! It saved me a lot of time and trouble!

  143. heyhey says:

    oh god, you just saved me from that damn ie. thanks!

  144. David C says:


  145. Jignesh Thummar says:

    Thanks a lot man u saved my hours....... ;)

  146. Balaji Chopparapu says:

    Kudos dude. You saved me.

  147. Kate says:

    Just adding to the chorus! Thankfully, I'd googled first, so I only looked in two places before I found the comma that was breaking IE7 and not IE8!

  148. Marvin B. Aya-ay says:

    What a monster IE small mistake is not allowed.
    By the way thanks to your post you save big pain and my time.


    Thank you very much.

  149. fei says:

    Many thanks!
    you save my life too!! This error appears only below version IE8.
    I think IE8 automatically ignore this comma :)
    P.S.: Hate IE, HATE! :)

  150. Nick says:

    Thanks for this - saved me another trip down to angry town.

  151. June MN says:

    Thanks man!! thanks for sharing..

  152. Eric says:

    Doh! (slaps forehead)
    Same problem, thanks for sharing!

  153. JPlayer says:

    GUUHHHHHH!!! Thank you SO MUCH for posting this. I spent about an hour trying to figure out why IE was being so picky (would've helped to know the correct line number...IE was WAY off). This is EXACTLY what my problem was. THANK YOU!

  154. jsprog says:

    Thank you!!! I had the same issue with my code =)

  155. Brian Kuyath says:

    Just saved me about 8 hours of debugging! Thanks much!

  156. prashanth says:

    Thanks for your valuable post....
    I had the same problem and looking into ur post i have rectified it within a minute.. Thanks a lot.....

  157. Maisara says:

    thanks :)

  158. Einat says:

    You life saver!!!

  159. Ran says:

    Hi. Nice Hint. Thank you...!!!

  160. alex says:

    thanks, solved my problem.

  161. Srikar says:

    Thanks a lot for such a detailed explanation!! It helped me many hours of debugging.

  162. Skat says:

    Thank you very much. IE 6&7 were torturing me with this error.

  163. indira says:

    Reaaly thanks
    veryy simple resolution
    mase my day

  164. Avijit Sen says:

    Thank you very much for this help. Many many thanks.

  165. PL says:

    Thanks so much for this... IE7 was driving me crazy on this issue...


  166. jay says:

    Thanks man it saved my life.

    Thanks thanks thanks

  167. Deepak says:

    Thanks ! You saved my lots of time !!

  168. Tony says:

    Ha! Gotcha! Thanks for that very useful tip.

  169. tuba says:

    Thank you so much. It realy helps me.

  170. Joel Brown says:

    Thank you so much, it worked! Wow, I would have never figured this out on my own. You're going on delicious right now!

  171. Andrew Sepic says:

    THANK YOU! Yes, I was having the same issue. Glad to have learned about the answer and didn't waste too much time. :-)

    Thanks a bunch!

  172. Chris Pratt says:

    Finally solved my issue with this after stumbling upon your post. Thanks. Oddly, fixing this error in IE7 also corrected a different but equally frustrating problem in IE8 (which didn't actually generate a JavaScript error).

  173. Mathan says:

    Really thanks man.........

  174. imtiyaz says:

    Thank you very very very very very very very very very veryvery very very very veryvery very very very veryvery very very very veryvery very very very veryvery very very very veryvery very very very veryvery very very very veryvery very very very veryvery very very very very MUCH..........

  175. Rohan says:

    Thanks.. saved me time debugging this error

  176. Ashok says:

    Thanks a lot, I am also getting stuck on the same type of problem, after reading this "JavaScript Error ‘expected identifier, string or number’ in IE" blog.

    I got the solutions.


  177. RockerNJ says:

    Thanks so much! 1st hot on Google for the problem and picked off the problem exactly!

  178. Thanks so much for this post, we all need to be reminded to check for tiny, stupid errors from time to time! :)

  179. Teodor B says:

    Thank you vrey much for publishing this solution.

  180. Megan says:

    Saved my life! THanks a million.

  181. TOL says:

    Thank you guy! You saved my time too!

  182. limin says:

    Saved my life too! Thanks for sharing

  183. Ofer says:

    You, sir, are a life saver.

  184. sk_paul says:

    Thanks, and I will also post this solution to my blog. Thanks again. :)

  185. Sen says:

    Thanks a lot for sharing the information

  186. Patrick says:

    This helped me too, thanks.

  187. Ankita says:


    Works for me too.. Had a similar exception, and thankfully saw your post soon enough to fix it in 5 minutes :)


  188. Martin Tournoij says:

    Thank you!

  189. Bdawg says:

    Just wanted to say a quick thanks for taking the time to jot this down. Just helped me too.

  190. brijesh says:

    Thank you vrey much for publishing this solution.

  191. Kelly says:

    Thank you! That was exactly the problem I was having. You've saved me hours of debugging!

  192. sebastian says:

    Thanks this saved me a lot of time! Cudos

  193. Erin says:

    This just saved me a lot of time - thanks!!

  194. Aamir Talib says:

    Really Thanks, this helped me too

  195. Ryan Brown says:

    I am so grateful for this information, you sir are a diamond, thank you!

  196. Thanks, this helped me find the bug that broke navigation on a client site! Cheers to you (and Google)!

  197. Barry says:

    Thank you! I've spent the last 3 hours scouring through code to find this simple solution. I added a list of parameters into a shadowbox js and kept only one but left the comma.

    Don't know that I would have found it without this post! Thanks again!

  198. Thanks for this post information. It was just in time to avoid a headdache and some flying wireless keyboards ;)

  199. Harisastha says:

    Thanks. This helped me too.

  200. Tameshwar says:

    Thank you so much.. you saved my TIME!!!!!!!!!!

  201. eighthead says:

    Thank you so much. This was going to be the end of my sanity! You really helped!

  202. Emman says:

    thank you, it helped me much..

  203. mio says:

    Thanks!!!!! I forgot it!

  204. Thanks, you are a king.

    I never thought to look for the error on the line above like you pointed out.

    Worked like a charm.


  205. Kevin says:

    Thanks a ton for posting this. Probably saved me a few hours of headache this morning on a work project! :)

  206. jasani says:

    tks man...u just saved me lot of debugging hours and my project delay.

  207. Rico Chen says:

    Niiiiiice, this' exactly what I've been looking for. Thanks for sharing.

  208. DouggyT says:

    Love it, thanks heaps ta muchly.. Your 10 minutes made mine about 5 seconds!

  209. Lukas says:

    Hey man thank you this help me a lot ! such a stupid comma :D I spend two hours looking where i have a mistake a than i found this post. :)

  210. es says:

    holy cow! first thing that came up when i googled and it worked! thank you for posting.

  211. Yaron says:


  212. Andy says:

    You are a hero! Saved me hours of tearing my hair out!!

    You've got to love IE's attention to detail though :P

  213. Sanjay says:

    Thanks man......I also got stuck into same solved....

  214. Rohmel says:

    Like many before me, thanks for saving me the time of troubleshooting this issue with the bane of the web developers world, IE.

  215. Dhanapal says:

    Thank U so much., for your kind help..,

  216. dipak kumar burnwal says:

    hey thanks dude you really pull me out from hell i was searching for the solution for last 3 days and it was only today that i got solution
    thanks .....

  217. Tarun says:

    Thank you!!! I moved a block of code from one part of the file to another and was wondering why did it start breaking all of a sudden.

    the trailing comma!

  218. chris says:

    Thumbs up! You 're the best! Thank you so much! IE.. DIE!!! :)

  219. Patrick McL says:

    Just had the same problem and you saved me lots of time. Many thanks to you. Cheers! :)

  220. Juan says:


  221. Adel says:

    Exact problem with TinyMCE was only in IE9 com mode, they become more forgiving;

    toke me couple of mins thanks to you.

  222. zweiland says:

    Wow! Seems soooo simple, but you just saved me 42.7 hours and 17000 grey hairs.

  223. adam says:

    You just saved me, what could of been, hours of pain. Thank you! It's amazing that 3 years on IE is still this bad. It drives me nuts. Thanks again buddy!

  224. Ivan says:

    Oh thanks man, it was driving me crazy, but you helped a MUCH :)

  225. chaya says:

    thank you soo much .. saved my time a lot

  226. Jason says:

    I came here by way of Google and you've saved me a huge headache trying to get TinyMCE text editor to work on IE 8 and older browsers!

    Thanks for this post!

  227. Todd says:

    Damn you for not getting me to read your page sooner. I'm joking. Thanks for your article. I had exactly the same problem... but I probably wasted at least 30 minutes trying to debug it. Cheers!

  228. Miguel says:

    Dead on, thanks for posting this! Had the same problem, dumb IE...

  229. Sohail says:

    Thanks man. It really saved my time. I was just gonna mad to fix this issue.

  230. abdullah says:

    you da man yo! this helped me solve some critical modal issue i had. THANKS & GOD BLESS!

  231. Curtis says:

    Thanks for publishing, pointing this syntax error out. I discovered this error through IE compatibility mode. I don't blame Internet Explorer at all; it's just lack of experience on my part, and you have just doubled my knowledge of JavaScript semantics.

  232. Pungle says:

    So much time saved! Thank you very much!

  233. Chris says:

    Another thank you - solved my problem in 2 mins...

  234. Arepie says:


    i was searching for this problem about 4 hours, then stumble upon your web. You saved me! Thanks!

  235. Fahad Nasir says:

    Thanks I was also facing the same problem. This really helped me.

  236. thanks a lot for this post.. really helped me... thanks again...

  237. Brendan says:

    Thanks so much for this post! Just had the same problem and fixed it in 10 seconds thanks to this! You're still helping people 3 years later!

  238. Thanks. Saved me a boatload of time!!!

  239. vs says:

    thanks.. just had the same problem and you saved me a bunch of time.

    thanks a lot.

  240. gamasou says:

    Thankyou!! Saved me a lot of troubles!!! So simple distraction leads me to a big headache!!!

  241. Braidi says:

    Wish I would have found this page sooner. That little comma was causing major problems in IE 7, making very important pieces of my website not function.

  242. Mark says:

    was trying to get the iframe to change parent text [the count of items] in the store at this page for 3 days. Thank you !!!! for your help

    function changeText(newcount){
    var newcount = “php echo variable”;
    window.parent.document.forms[1].elements[0].value = ‘Total Items: ‘+ newcount;

  243. Erim Tuna says:

    Thank you so much! You're a life saver!

  244. Jana says:

    This works like a charm, still can't believe that one stupid comma was causing so many problems. Thank you so much !!!!

  245. Jake King says:

    Many thanks, saved me, and I can see from the comments, many other people a lot of time...

  246. pramodh says:

    Thanks, you saved me a lot of time

  247. tichaona says:

    it might be a late comment but hey you have saved my day

  248. Phil says:

    Thanks for the post. I helped with a bug I was working on.

  249. vishal says:

    thanks, it helped me..................................

  250. ira says:

    wow. i rarely comment on these forums but that was so helpful i just had to say thanks. probably would have taken forever to find that fix!! :)

  251. Evelien says:

    you saved me a lot of time....

  252. Ether says:

    You just gave me back hours in my life! Thanks!

  253. marjek says:

    Thank you! Got the same problem and this was the cause.

  254. Eric says:

    Still helpful after all these years. Thanks!

  255. Still alive and kicking! Exactly the problem. Thank you so much!

  256. Krieghoff says:

    This post is a time saver. Thank you for taking the time to post it.

  257. Robertino CUcaracho says:

    This are the little things that makes me hate Microsoft a little more every day. =D

    Thanks! I was just testing IE compatibility and found this errors all over the place. Damn it. XD

  258. pete says:

    reserved words will also produce the same error/effect.

    e.g. :
    var x = {
    class: "a"

    IE8 (9 ok)

  259. dave says:

    THANKS! You solved my problem right quick! Much appreciated.

  260. Venkata Kotra says:

    Thanks for the post. saved my developement time.

  261. Troop says:

    thx, your site was the first hit on google and saved me a LOT of time!

  262. sulfide says:

    please don't take this down, it's still 2012 and I have to deal with IE8 (just starting doing some web developing) and this definitely saved me some time...!

    Thank you!

  263. Stu says:

    Thanks for this. You saved me the trawl through the 10 pages of google results!

  264. starrs5 says:

    Thanks man! you've saved my day

  265. Nolan says:

    Thank you sir!!! You solved the problem I was having in IE! You're awesome!

  266. nazeer says:

    plot1 = $.jqplot('chart1',[cosPoints],{
    title: 'Highlighting, Dragging, Cursor and Trend Line',
    axes: {
    xaxis: {
    renderer: $.jqplot.DateAxisRenderer,
    tickOptions: {
    formatString: '%m/%d/%Y'
    numberTicks: 4
    yaxis: {
    tickOptions: {
    formatString: '%d'
    min: 0,

    highlighter: {
    sizeAdjust: 10,
    tooltipLocation: 'n',
    tooltipAxes: 'y',
    tooltipFormatString: 'hello %.2f',
    useAxesFormatters: false
    cursor: {
    show: true

    this is my jquery jqplot plug in graph , its working perfectly in firefox but in ie i got error "Expected identifier, string or number" in line number 88 but my line number 88 is formatString: '%m/%d/%Y' so please can any one tel me the solutin what i should do please tel me if anyone known this

  267. Bharat says:

    Thanks a lot Ryan. I wasted a lot of time on this. This has solved my problem.

  268. DonDon says:

    Thanks !!! This is great solution. I can wait for IE 7 & IE8 to go away!

  269. Thanks, you rock.

    This was my problem, too. I was actually explicitly leaving the last comma in, so that there wouldn't be "accidents" if people copy/paste lines of code, as they'd all end in commas.

    Now I know to avoid doing that for the plebs that haven't upgraded from IE yet.

  270. Siddhesh says:


    I also commited the same mistake :( . Thanks for pointing out .

  271. Robin says:

    In case anyone can't seem to find the code that causes the error here is a little RegEx snippet you can use:
    it should find all occurances of ",[spaces/tabs and/or new line]}"

    I used it in combination with the Aptana Eclipse plugin which has a wonderfull (and extemely usefull) 'Search in all files' function that supports

  272. Sethxian says:

    Thank you much, you saved me lots of frustration.

  273. Jesse says:

    Thank you!!

  274. John Pilley says:

    Thanks! I wasted an hour until I saw your post.

  275. twitter_nookeen says:

    I feel like saying duuuh... thanks, it was a true AHA moment for me...

  276. wakaso says:

    thanks a lot, the only thing confusing me for hours just a comma ','. After remove it, it works like a jerk.

  277. Dorian says:


  278. hamideh says:

    Thank you. It really helped me.

  279. Enissay says:

    You are my hero thanks a lot ^^

  280. facebook_Eduardo Oliveira.100003375601597 says:

    Worked here! A simple think making big problems. Thanks.

  281. Vega says:

    YOU ARE AWESOME!!!!! You saved me countless hours of javascript debugging. Thanks for finding reason 2,993,882,581 why I hate IE :)

  282. Ashraf Bashir says:

    That's awesome ... it works finally !

  283. Mats says:

    Death to IE!

  284. kelly says:

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
    Timestamp: Wed, 15 May 2013 07:37:04 UTC

    Message: Expected ':'
    Line: 78
    Char: 525
    Code: 0

    Can someone please tell me how to fix this error im a total novice so any help appreciated. Many Thanks Kelly

  285. anony says:

    Thank You! helped me :)

  286. a says:

    Thanks for ones marvelous posting! I genuinely enjoyed
    reading it, you could be a great author.
    I will make certain to bookmark your blog and will come back very soon. I want to encourage you continue your
    great job, have a nice day!

  287. It's going to be end of mine day, but before end I
    am reading this impressive article to improve my knowledge.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>