Sets or retrieves the hostname and port number of the location or url.
dhtml语法
html | n/a |
---|
scripting | object.host [ = shost ] |
---|
dhtml可能的值
sHost | String that
specifies or receives the host name and port number. |
The property is read/write.
The property has no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see about dynamic properties.
remarks
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.
the host property may be set at any time, although it is safer to set the href property to change a location. if the specified host cannot be found, an error is returned.
DHTML代码范例
This example function returns the host property of the current page location.
function getHost()
{
return document.location.host;
}
是否符合公共标准
There is no public standard that applies to this property.
Applies To