Having fun with IE part 5 - what item?

By crisp on Tuesday 17 November 2009 01:13 - Comments (3)
Categories: Browsers, Javascript, Views: 5.518

Some more IE-weirdness.


JavaScript:
1
alert(window.item == window);


Why is 'item' special in IE's global scope?

Volgende: Spam @ tweakblogs 11-'09 Spam @ tweakblogs
Volgende: IPv6 validation - more caveats 11-'09 IPv6 validation - more caveats

Comments


By Tweakers user Jejking, Tuesday 17 November 2009 02:36

Because it's Microsoft? :?

What are you trying to say here.

By Tweakers user sunflame, Tuesday 17 November 2009 07:06

Since IE puts every object with a name or ID in the global scope, I wouldn't be surprised if it reserves item as a property of window

window.item(0)

being equivalent to the first element with a name or ID.
Ergens gevonden binnen een discussie uit 2003.

By Tweakers user crisp, Tuesday 17 November 2009 08:34

Yes, it's a result of MS having built DOM on top of their document.all object model. This is just something I recently found in a case where it was the cause of strange behaviour in IE.

Comments are closed