URL of the window.
Browser/User Agent Support
| IE | Mozilla | Netscape | Opera | Safari | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|---|
Constructors
| Constructor | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|
Creates a new instance of a Location object. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Properties
| Property | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|
Anchor portion of the URL. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Host name and port of the URL. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Host name of the URL. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Complete text of the URL. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Path name portion of the URL. (e.g. "/docs/index.html") | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Port portion of the URL. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Protocol portion of the URL. ("http" or "https") | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Query string portion of the URL. | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
Methods
| Method | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|
Reloads the current URL. | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
Replace the document of the current URL with the document from another URL. | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ |
References
Availability
JavaScript 1.0 | enhanced in JavaScript 1.1
Constructor Detail
Property Detail
String hash
Anchor portion of the URL.
String host
Host name and port of the URL.
String hostname
Host name of the URL.
String href
Complete text of the URL.
String pathname
Path name portion of the URL. (e.g. "/docs/index.html")
String port
Port portion of the URL.
String protocol
Protocol portion of the URL. ("http" or "https")
String search
Query string portion of the URL.
Method Detail
reload(Boolean force) : Object
Reloads the current URL.
| Boolean | force | Specify true to reload the document from the server even if it has not been modified since it was last loaded. |
- Availability
JavaScript 1.1
replace(String url) : Object
Replace the document of the current URL with the document from another URL.
| String | url | URL to replace the current document with. |
- See Also
- Availability
JavaScript 1.1
