My favorites | Sign in
Project Logo
             
Search
for
Updated Sep 19, 2008 by pilgrim
Labels: about-dom, is-dom-property
LocationHostProperty  
The location.host property is the concatenation of the hostname and port properties.

Values

location.host is hostname + port number, separated by a colon (i.e. hostname:port). When the port property is null, the host property is the same as the hostname property.

If the location comes from an frame, reading this variable may throw an exception if the domains are different.

The location.host property returns a string.

This property is read/write.

Usage

Browser compatibility

Compatibility table legend

Test IE8 IE7 IE6 FF3 FF2 Saf3 Op9 Chrome
typeOf(location.host) != 'undefined' Y Y Y Y Y Y Y Y

Further reading


Comment by scottakirkwood, May 20, 2008

The host property is the concatenation of the hostname and port properties, separated by a colon (hostname:port). When the port property is null, the host property is the same as the hostname property.

If the location comes from an frame reading this variable may throw an exception if the domains are different.


Sign in to add a comment
Hosted by Google Code