0% found this document useful (0 votes)
13 views

Window and Document Object

The document discusses the JavaScript object hierarchy including the Window, Document, Location, Navigator, and History objects. The Window object represents a browser window. The Document object provides access to HTML elements. The Location object contains URL information. The Navigator object contains browser information. The History object contains visited URLs.

Uploaded by

Aman Pal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Window and Document Object

The document discusses the JavaScript object hierarchy including the Window, Document, Location, Navigator, and History objects. The Window object represents a browser window. The Document object provides access to HTML elements. The Location object contains URL information. The Navigator object contains browser information. The History object contains visited URLs.

Uploaded by

Aman Pal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

JavaScript Object Hierarchy

• Window Object
• The window object represents an open
window in a browser.
• If a document contain frames (<frame> or
<iframe> tags), the browser creates one
window object for the HTML document, and
one additional window object for each frame.
• Document Object
• Each HTML document loaded into a browser
window becomes a Document object.
• The Document object provides access to all
HTML elements in a page, from within a script.
• Location Object
• The location object contains information
about the current URL.
• The location object is part of the window
object and is accessed through the
window.location property
Navigator Object
• The navigator object contains information about the browser.
• Navigator Object Properties
• PropertyDescription
• appCodeName Returns the code name of the browser
• appName Returns the name of the browser
• appVersion Returns the version information of the browser
• cookieEnabled Determines whether cookies are enabled in the
browser
• Platform Returns for which platform the browser is compiled
• userAgent Returns the user-agent header sent by the browser
to the server
• Navigator Object Methods
• MethodDescription
• javaEnabled() Specifies whether or not the browser has Java enabled
• taintEnabled()Specifies whether or not the browser has data tainting
enabled
• History Object
• The history object contains the URLs visited by
the user (within a browser window).
• The history object is part of the window object
and is accessed through the window.history
property.

You might also like