- {string}
获取及设置 URL 的主机部分。
const myURL = new URL('https://example.org:81/foo');console.log(myURL.host);// 打印 example.org:81myURL.host = 'example.com:82';console.log(myURL.href);// 打印 https://example.com:82/foo
分配给 host 属性的无效主机值将会被忽略。
获取及设置 URL 的主机部分。
const myURL = new URL('https://example.org:81/foo');console.log(myURL.host);// 打印 example.org:81myURL.host = 'example.com:82';console.log(myURL.href);// 打印 https://example.com:82/foo
分配给 host 属性的无效主机值将会被忽略。
若有收获,就点个赞吧
0 人点赞
让时间为你证明