2014-02-14 66 views
2

在JavaScript中,「文檔」「文檔」有什麼區別?javascript中的文檔vs文檔

typeof文件是我們在編程中經常使用的對象& typeof文件是函數。

Document函數的用途以及在哪裏使用它?

+0

我很願意解散這個問題,直到我開始[尋找到它(https://developer.mozilla.org/en-US/docs/Web/API/document) 。在這一點上,我最好的猜測是Document()是'document'對象的基類,但是我找不到關於這個的明確聲明... –

+0

請看這裏http://www.domenlightenment.com/# 2。 – elclanrs

+0

而這裏http://reference.sitepoint.com/javascript/Document – elclanrs

回答

1

谷歌搜索給了我這些結果:

The Document interface inherits from Node, and represents the whole document, such as an HTML page. Although the Document node is conceptually the root of a document, it isn't physically the root - the root node is the first Element node in the Document, and is represented by its documentElement property.

來源:http://reference.sitepoint.com/javascript/Document

Both Document and HTMLDocument constructors are typically instantiated by the browser when you load an HTML document. However, using document.implementation.createHTMLDocument() its possible to create your own HTML document outside of the one currently loaded into the browser. In addtion to createHTMLDocument() its also possible to create a document object which has yet to be setup as an HTML document using createDocument(). Typically the use of theses methods are associated with programatically providing an HTML document to an iframe.

來源:http://www.domenlightenment.com/#2

更多信息: