About

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):

Property

Address

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.

Referrer

The document.referrer returns the referer (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.

There is no path, only the apex domain.

How to manage Cookies in the Browser via Javascript?

State

See Web - Timeline of a page load (Page Speed|Page Latency)

Type

  • HTML,
  • XML,
  • SVG,

With the Javascript document variable

type = document.contentType;
console.log("The document type is ("+type+")");

Flag

Reload

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.

Documentation / Reference