Kung Fu Kung Fu

Fujian White Crane Kung Fu

Zope Zope

What I have and am doing with Zope

Photos Photos

Photoalbum, both old and new.

Receptsamlingen Receptsamlingen

In Swedish only. About my "Collection of Recipes" website.

Contact me Contact me

My contact details and how to contact me.

  Mobile version of this page Mobile version of this page


 

Associative arrays

javascript syntax, syntax errors, internet explorer, firebug, commas, associative, arrays

20th of March 2007

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


Comment

Pierre - 7th January 2008  [«« Reply to this]
Thank you for bringing this up.

I did pull some hairs before finding your post.
 
Name:
Email:
hide my email address.

Your email address will be encoded to prevent email-extraction spiders from reading it so you won't get spammed if you decide to show your email address.