A fun IE9 surprise

Every time I have to debug an IE9 (or lower) issue, a puppy dies. You don’t want puppies to die do you? Browse happy: http://t.co/v4MCw2MOkH
— John Naegle (@johnnaegle) November 11, 2014

As much as I would like to avoid having to deal with IE8 and IE9, sometimes that is just a requirement of the job. Today, I ran across a fun JavaScript bug.

Can you spot it below?

In IE9, item is a function and since the loop left out the var keyword before item, there wasn’t a local variable named item in the block.  The fix is simple, finding the bug, not so much.

Do yourself a favor and save a puppy, get a modern browser, and Browse Happy.

One thought on “A fun IE9 surprise”

Leave a Reply

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