WorkerLocation: toString() Methode
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since Juli 2015.
Hinweis: Diese Funktion ist nur in Web Workers verfügbar.
Die toString()-Stringifier-Methode eines WorkerLocation-Objekts gibt eine Zeichenkette zurück, die die serialisierte URL für den Standort des Workers enthält. Sie ist ein Synonym für WorkerLocation.href.
Syntax
js
toString()
Parameter
Keine.
Rückgabewert
Keiner (undefined).
Beispiele
js
// In a Web worker, on the page https://big.rakal.top/en-US/docs/Web
const result = location.toString(); // Returns 'https://big.rakal.top/en-US/docs/Web'
Spezifikationen
| Specification |
|---|
| HTML> # workerlocation> |
Browser-Kompatibilität
Loading…
Siehe auch
- Die
WorkerLocation-Schnittstelle, zu der sie gehört.