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 |
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
Method | Description |
---|---|
javaEnabled() | Specifies whether or not the browser has Java enabled |
taintEnabled() | Specifies whether or not 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 | Returns the anchor portion of a URL |
host | Returns the hostname and port of a URL |
hostname | Returns the hostname of a URL |
href | Returns the entire URL |
pathname | Returns the path name of a URL |
port | Returns the port number the server uses for a URL |
protocol | Returns the protocol of a URL |
search | Returns the query portion 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 |
No comments:
Post a Comment