WorkerLocation:host 屬性
注意:此功能僅在 Web Workers 中可用。
host 屬性是 WorkerLocation 物件的一個屬性,它返回 worker 位置的 host 部分。
值
字串。
示例
js
// In a Web worker, on the page https://:8080/
const result = location.host; // Returns 'localhost:8080'
規範
| 規範 |
|---|
| HTML # dom-workerlocation-host |
瀏覽器相容性
載入中…
另見
- 它所屬的
WorkerLocation介面。