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 GitHubdesktop | mobile | server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
toString |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Siehe auch
- Die
WorkerLocation
-Schnittstelle, zu der sie gehört.