3

See image:

enter image description here

Similar question on Microsoft website: http://connect.microsoft.com/IE/feedback/details/785194/function-item-native-code

Tried Google.com, Facebook, StackOverflow - every website I visit has this weird feature. Fire up your IE9 (haven't tested other versions) and type item in you development console.

If I haven't tried other websites I would think that there is a <div id="item"> see also:

So on this occasion the question is - why function item() is present on so many websites when IE is used?


UPDATE: super simplified test case. enter image description here

Community
  • 1
  • 1
Mars Robertson
  • 12,673
  • 11
  • 68
  • 89

1 Answers1

6

It's a function on the window object. in Internet Explorer. It's not part of the websites, in other words, it's part of the browser.

It's from the HTMLCollection interface, part of the DOM spec. Internet Explorer seems to consider the window object to be a collection.

Pointy
  • 405,095
  • 59
  • 585
  • 614
  • 6
    Quick and easy! I was doomed by not using ```var``` in the following statement ```for (item in basket.items)``` (lesson learnt) – Mars Robertson Jan 10 '14 at 22:47
  • OMG microsoft is so stupid, sigh. Year after year. The hair-loss of developers is criminal... – Kevin Jun 03 '15 at 02:20
  • @MichalStefanow: I just had a similar problem with `close` and couldn't figure out what was happening. Thanks! – kontextify Aug 04 '17 at 18:41