我注意到,如果您编写这样的程序:
console.log(document);
它显示[object HTMLDocument]
. 然后,如果你这样做:
console.log(HTMLDocument);
它显示了这一点:
function HTMLDocument() {
[native code]
}
所以,我想知道这个HTMLDocument
函数是什么,它的代码是什么。谢谢!
我注意到,如果您编写这样的程序:
console.log(document);
它显示[object HTMLDocument]
. 然后,如果你这样做:
console.log(HTMLDocument);
它显示了这一点:
function HTMLDocument() {
[native code]
}
所以,我想知道这个HTMLDocument
函数是什么,它的代码是什么。谢谢!
这是 HTMLDocument 对象的构造函数。
文档:
可以通过 Window.HTMLDocument 属性访问的 HTMLDocument 接口扩展了 Window.HTMLDocument 属性以包含特定于 HTML 文档的方法和属性。
本机代码是浏览器提供的核心功能,而不是用 Javascript 编写的代码。