【发布时间】:2011-12-30 18:11:18
【问题描述】:
这看起来很奇怪。
这是我在 IE8 控制台中的实验:
typeof obj1 // "object"
obj1.hasOwnProperty // {...}
typeof obj2 // "object"
obj2.hasOwnProperty // undefined
关于什么可能导致这种情况的任何想法?
【问题讨论】:
-
obj2 是宿主对象吗?你在 IE7/ IE8 / quirks 模式下吗?
-
关于
difference between native objects and host objects?:stackoverflow.com/questions/7614317/… -
一种不需要使用 hasOwnProperty() 的解决方法:hasOwnProperty() is undefined on the window object in IE8 and causes a TypeError
-
我遇到了这个问题,因为我想知道对象中是否存在属性,我可以通过这个链接解决:stackoverflow.com/questions/11040472/…
标签: javascript internet-explorer-8 ie-developer-tools hasownproperty