[go: up one dir, main page]

0% found this document useful (0 votes)
214 views2 pages

Navigator Object: Appcodename Appname Appversion Cookieenabled Geolocation Language Online Platform Product Useragent

The document discusses several browser objects - the navigator object, which contains information about the browser; the screen object, which contains information about the user's screen; the history object, which contains the URLs visited by the user within a browser window; and the location object, which contains information about the current URL. Each object is described, including its properties and methods.

Uploaded by

dorinadid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
214 views2 pages

Navigator Object: Appcodename Appname Appversion Cookieenabled Geolocation Language Online Platform Product Useragent

The document discusses several browser objects - the navigator object, which contains information about the browser; the screen object, which contains information about the user's screen; the history object, which contains the URLs visited by the user within a browser window; and the location object, which contains information about the current URL. Each object is described, including its properties and methods.

Uploaded by

dorinadid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Navigator Object

The navigator object contains information about the browser.


Note: There is no public standard that applies to the navigator object, but all major browsers support it.
Navigator Object Properties
Property Description
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
geolocation Returns a Geolocation object that can be used to locate the user's position
language Returns the language of the browser
onLine Determines whether the browser is online
platform Returns for which platform the browser is compiled
product Returns the engine name of the browser
userAgent Returns the user-agent header sent by the browser to the server
Navigator Object Methods
Method Description
javaEnabled() Specifies whether or not the browser has Java enabled
taintEnabled() Removed in JavaScript version 1.2. Specifies whether the browser has data tainting
enabled

Screen Object
The screen object contains information about the visitor's screen.
Note: There is no public standard that applies to the screen object, but all major browsers support it.
Screen Object Properties
Property Description
availHeight Returns the height of the screen (excluding the Windows Taskbar)
availWidth Returns the width of the screen (excluding the Windows Taskbar)
colorDepth Returns the bit depth of the color palette for displaying images
height Returns the total height of the screen
pixelDepth Returns the color resolution (in bits per pixel) of the screen
width Returns the total width of the screen

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.
Note: There is no public standard that applies to the history object, but all major browsers support it.
History Object Properties
Property Description
length Returns the number of URLs in the history list
History Object Methods
Method Description
back() Loads the previous URL in the history list
forward() Loads the next URL in the history list
go() Loads a specific URL from the history list
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.
Note: There is no public standard that applies to the location object, but all major browsers support it.
Location Object Properties
Property Description
hash Sets or returns the anchor part (#) of a URL
host Sets or returns the hostname and port number of a URL
hostname Sets or returns the hostname of a URL
href Sets or returns the entire URL
origin Returns the protocol, hostname and port number of a URL
pathname Sets or returns the path name of a URL
port Sets or returns the port number of a URL
protocol Sets or returns the protocol of a URL
search Sets or returns the querystring part of a URL
Location Object Methods
Method Description
assign() Loads a new document
reload() Reloads the current document
replace() Replaces the current document with a new one

You might also like