Window and Document Object
Window and Document Object
• 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.