location (JavaScript 1.0)

URL of the window.

Properties & Events

KeyDescriptionAvailability
hashAnchor portion of the URL.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
hostHost name and port of the URL.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
hostnameHost name of the URL.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
hrefComplete text of the URL.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
pathnamePath name portion of the URL. (e.g. "/docs/index.html")
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
portPort portion of the URL.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
protocolProtocol portion of the URL. ("http" or "https")
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0
searchQuery string portion of the URL.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 7.0

Result from the Online TryIt-Editor
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera 4.0

Examples having uses of: 'location'