WorkerLocation: thuộc tính href
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Note: This feature is only available in Web Workers.
Thuộc tính href của đối tượng WorkerLocation trả về một chuỗi chứa URL đã được tuần tự hóa cho vị trí của worker.
Giá trị
Một chuỗi.
Ví dụ
js
// Trong một Web worker, trên trang https://mdn.go-mizu.dev/vi/docs/Web
const result = location.href; // Trả về 'https://mdn.go-mizu.dev/vi/docs/Web'
Thông số kỹ thuật
| Specification |
|---|
| HTML> # dom-workerlocation-href> |
Tương thích trình duyệt
Xem thêm
- Giao diện
WorkerLocationmà thuộc tính này thuộc về.