WorkerLocation: toString() Methode

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://developer.mozilla.org/en-US/docs/Web
const result = location.toString(); // Returns 'https://developer.mozilla.org/en-US/docs/Web'

Spezifikationen

Specification
HTML
# workerlocation

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
toString

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch