Thursday, April 4, 2013

Javascript History and Location Object


The History object is actually a JavaScript object, not an HTML DOM object.

History Object Methods
back() Loads the previous URL in the history list
forward() Loads the next URL in the history list
go() Loads a specific page in the history list

The Location object is actually a JavaScript object, not an HTML DOM object.
Location Object Properties
Hash Sets or returns the URL from the hash sign (#)
Host Sets or returns the hostname and port number of the current URL
Hostname Sets or returns the hostname of the current URL
Href Sets or returns the entire URL
Pathname Sets or returns the path of the current URL
Port Sets or returns the port number of the current URL
Protocol Sets or returns the protocol of the current URL
Search Sets or returns the URL from the question mark (?)

Location Object Methods
assign() Loads a new document
reload() Reloads the current document
replace() Replaces the current document with a new one

No comments:

Post a Comment