getElementByID in IE 8 compared to previous versions

Found this post about the getElementByID method in Javascript by accident and thought it would be worth posting about.

The basic issue is is that IE 8 compares the id’s is a case-sensitive manner whereas previous versions of IE compare in case-insensitive manner when IE 8 is in actual IE 8 mode. (MS Doc Here)

I always try and keep my identifiers in the same case in all cases, and this is just another reason for me to keep doing that!

Moral of the story: No matter what you do and what language you work in you should endeavour to keep the casing of variables, css classes, uri etc, in exactly the same case in all instance. This helps when in the future something like this happens.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: