2

I was messing around with Chrome's console, and I found a function (in all websites) named Document. I tried to look this up, but since Google isn't case sensitive, I just found info about document.getElement...(). This function doesn't appear to be a JSON object, like document, but an actual function.

enter image description here

What is this function, and what is it used for?

The MDN Page still seems to be referencing document instead of Document, as seen below.

enter image description here

I just tested this in Firefox with both the built in console and Firebug, and it returns the same as the above screenshot.

I have found that both MDN and W3 reference the document object as "Document", even though the Document function is not the same as the document object.

ZomoXYZ
  • 1,763
  • 21
  • 44

1 Answers1

1

The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. The DOM tree includes elements such as <body> and <table>, among many others. It provides functionality which is global to the document, such as obtaining the page's URL and creating new elements in the document.

https://developer.mozilla.org/en-US/docs/Web/API/document

Armand
  • 23,463
  • 20
  • 90
  • 119
  • this still seems to be dealing with `document` (lowercase), as I see whenever I follow any link on that mdn page. I will include a screenshot and some more information as an edit to my question. – ZomoXYZ Apr 07 '16 at 15:33
  • `document` is likely an instance of `Document` – Armand Apr 07 '16 at 15:34
  • You can create more instances of `Document` with e.g. jQuery's `parseXML()` function: https://api.jquery.com/jQuery.parseXML/ – Armand Apr 07 '16 at 15:35