DOM - Document (Object)
Every XML doc and HTML document (Web page) in an HTML UA is represented by a Document object.
A document in the context of a browser is generally a HTML document (Web Page).
The Document interface is the entry point to the whole DOM tree.
In a browser, it represents the whole web page.
A Document is created (the creation of the DOM):
- by a script using the createDocument() or createHTMLDocument() DOM APIs.
The document's address is an absolute URL that is initially set when the Document is created but that can change during the lifetime of the Document, for example when the user navigates to a fragment identifier on the page or when the pushState() method is called with a new URL.
The document . referrer returns the address of the Document (an absolute URL) from which the user navigated. If it is not explicitly set, then its value is the empty string.
See Web - Timeline of a page load (Page Speed|Page Latency)
type = document.contentType; console.log("The document type is ("+type+")");
Each Document object has a reload override flag that is originally unset. The flag is set by the document.open() and document.write() methods in certain situations.