URLUtilsReadOnly.host
Experimental
This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The URLUtilsReadOnly
.host
read-only property returns a DOMString
containing the host, that is the
hostname, a ':'
, and the port of the URL.
Syntax
string = object.host;
Examples
// In a Web worker, on the page https://developer.mozilla.org/en-US/URLUtilsReadOnly.host
var result = window.self.host; // Returns:'developer.mozilla.org:80'
Specifications
Specification | Status | Comment |
---|---|---|
URL The definition of 'URLUtilsReadOnly.host' in that specification. |
Living Standard | Initial definition. |
Browser compatibility
BCD tables only load in the browser
See also
- The
URLUtilsReadOnly
interface it belongs to.