hostname
特性为
URL
接口是
USVString
containing the
domain name
of the URL.
const domain = url.hostname url.hostname = domain
A
USVString
.
const url = new URL('../API/URL/hostname');
console.log(url.hostname); // Logs: 'developer.mozilla.org'
| 规范 | 状态 | 注释 |
|---|---|---|
|
URL
The definition of 'URL.hostname' in that specification. |
实时标准 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
hostname
|
Chrome Yes | Edge 13 | Firefox 22 | IE No | Opera Yes | Safari 10 | WebView Android Yes | Chrome Android Yes | Firefox Android 22 | Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
不支持
URL
interface it belongs to.