开发者

typeof document['domConfig'] thows an error in Firefox

Why does this expression:

typeof document['domConfig']

throw an error in Firefox (4)?

All the other browsers (IE9, Chrome 10, Safari 5, Opera 11) do not throw an error on tha开发者_开发知识库t line!

Live demo: http://jsfiddle.net/TvBeT/

Btw, document.domConfig is a property defined in the DOM Core spec.


None of the other browser define document.domConfig, so they return undefined.

More interesting, firefox 4 is the only browser that can run document.normalizeDocument(), which method gives domConfig a value while it is running, merging adjacent text-nodes and adjusting the containment of bad html tags on an existing or newly created Document..


From the MDN page on domConfig:

This feature has been removed from the Web. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜