For hard cord Javascript developers this comes as no surprise but if you, like me, do all your work in Firefox (of course with Firebug installed) then you need to keep a close eye on the correctness of your Javascript syntax because Internet Explorer will have some difference ways of thinking about it. Here's what I learnt the other day. This works perfectly in Firefox:


var person = { age:27, name:"Peter", };

But if you run that in IE you get "Expected identifier, string or number".

I know that SQL raises syntax errors on trailing commas but Python sure doesn't and I like that.

What a pointless rant this was. More like a note to self that might hopefully help someone else some day.

correct.html
incorrect.html

Comments

Pierre

Thank you for bringing this up.

I did pull some hairs before finding your post.

Your email will never ever be published.

Previous:
Zope Image to filesystem image March 16, 2007 Zope
Next:
Learning about ATFolder's security March 22, 2007 Plone
Related by category:
Fastest way to find out if a file exists in S3 (with boto3) June 16, 2017 Web development
Be very careful with your add_header in Nginx! You might make your site insecure February 11, 2018 Web development
<datalist> looks great on mobile devices August 28, 2020 Web development
How to have default/initial values in a Django form that is bound and rendered January 10, 2020 Web development
Related by keyword:
How do you thousands-comma AND whitespace format a f-string in Python March 17, 2024 Python
Button tag in bloody Internet Explorer August 9, 2005 Web development
Merge two arrays without duplicates in JavaScript September 20, 2018 JavaScript
Why I gave up on JQuery UI's autocomplete October 20, 2010 JavaScript