All Objects
Location Object
Location.hash
Location.hostname
Location.href
Location.pathname
Location.port
Location.protocol
Location.search
PROPERTY: Location::host
location.
host
host
is a property of both the
Link
and the
Location
objects and is a string comprising of the
hostname
and
port
strings. If the
port
property is the default of 80, then the
hostname
property is the same as the
host
property. Assuming your current window to be the URL...
http://home.newco.com/products/enquiries.htm#local?email=name@otherco.com
...you could find out the
host
property as follows:
Code:
document.write(location.host)
Output:
home.newco.com:80
NOTE:
Although the
host
property can be set at any time, it is safer to set the
href
property to change a location.
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information