JavaScript Reference :: Location

A Location object is part of the Window object and is accessed through the location property of the window. It is a Link type. Once you have the element, you can assign event handlers or modify the properties.

methods

void reload()
Reloads the page.
void replace(URL)
Replaces the current History location object with the specified URL.

properties

constructor
The constructor method is the base method used to create an instance of the object.
hash
The anchor portion of the href. For example, in the URL "http://www.cathmhaol.com/license/license-standard-plv.htm#excluded_activities" the hash is #excluded_activities.
host
The host portion (i.e. the domain) and port portion of the href. For example, in the URL "http://www.cathmhaol.com:800/license/index.asp?domain=cathmhaol.com&filename=license.asp", the host is "cathmhaol.com:800".
hostname
The host portion of the href, i.e. the domain. For example, in the URL "http://www.cathmhaol.com/license/index.asp?domain=cathmhaol.com&filename=license.asp", the hostname is "cathmhaol.com".
href
The URL of the link object.
pathname
The path portion of the href, i.e. the portion of the URL between the host and the query string. For example, in the URL "http://www.cathmhaol.com/license/index.asp?domain=cathmhaol.com&filename=license.asp", the pathname is "license/index.asp".
port
The port portion of the href. For example, in the URL "http://www.cathmhaol.com:80/license/index.asp?domain=cathmhaol.com&filename=license.asp", the pathname is "80".
protocol
The protocol portion of the href, e.g. ftp, http, or mailto.
prototype
Exposes the prototype for the method or property of the object.

events