【问题标题】:Internet Explorer weirdness - function item() { [native code] } - what does it do?Internet Explorer 的怪异之处 - function item() { [native code] } - 它有什么作用?
【发布时间】:2014-01-10 22:39:39
【问题描述】:

看图:

微软网站上的类似问题:http://connect.microsoft.com/IE/feedback/details/785194/function-item-native-code

试过 Google.com、Facebook、StackOverflow - 我访问的每个网站都有这个奇怪的功能。启动您的 IE9(尚未测试其他版本)并在您的开发控制台中输入 item。

如果我没有尝试过其他网站,我会认为有一个<div id="item"> 另请参阅:

所以这次的问题是——为什么在使用 IE 时,function item() 会出现在这么多网站上?


更新:超级简化的测试用例。

【问题讨论】:

    标签: javascript internet-explorer internet-explorer-9


    【解决方案1】:

    It's a function on the window object. 在 Internet Explorer 中。它不是网站的一部分,换句话说,它是浏览器的一部分。

    它来自 HTMLCollection 接口,是 DOM 规范的一部分。 Internet Explorer 似乎将window 对象视为一个集合。

    【讨论】:

    • 快速简单!我注定不会在以下声明中使用var for (item in basket.items)(经验教训)
    • OMG 微软太傻了,叹息。一年又一年。开发人员的脱发是犯罪……
    • @MichalStefanow:我刚刚遇到了与close 类似的问题,但无法弄清楚发生了什么。谢谢!
    猜你喜欢
    • 2013-01-14
    • 2011-04-26
    • 2014-03-28
    • 2015-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-24
    • 1970-01-01
    相关资源
    最近更新 更多