English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Location object represents the position of the current URL (URL).
The Location object iswindow (Window)Part of an object that can be written without a window prefix.
The following table lists the properties of the Location object:
Property | Description |
---|---|
hash | Set or return the anchoring part (#[hash]) of the URL |
host | Set or return the hostname and port number of the URL |
hostname | Set or return the hostname of the URL |
href | Set or return the entire URL |
origin | Return the protocol, hostname, and port number of the URL |
pathname | Set or return the pathname of the URL |
port | Set or return the port number of the URL |
protocol | Set or return the protocol of the URL |
search | Set or return the querystring part of the URL |
The following table lists the methods of the Location object:
Method | Description |
---|---|
assign() | Load resources on the URL provided in the parameters |
reload() | Reload the resource from the current URL |
replace() | Replace the current resource with the resource provided in the URL |