Location : Object

URL of the window.

Browser/User Agent Support

IEMozillaNetscapeOperaSafari
3.0+1.0+2.0+7.0+1.0+

Constructors

ConstructorIEMozillaNetscapeOperaSafari
Creates a new instance of a Location object.
3.0+1.0+2.0+7.0+1.0+
 

Properties

PropertyIEMozillaNetscapeOperaSafari
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

MethodIEMozillaNetscapeOperaSafari
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

Link | Window.location

Availability

JavaScript 1.0 | enhanced in JavaScript 1.1

Constructor Detail

Location Location()

Creates a new instance of a Location object.

Visibility
internal

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.

BooleanforceSpecify 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.

StringurlURL to replace the current document with.

See Also

History

Availability

JavaScript 1.1