JavaScript document.location Verwendung

Erklärung der Verwendung von JavaScript document.location

Dieser Artikel erklärt die Verwendung von JavaScripts document.location.

Shou Arisaka
1 Min. Lesezeit
7. Nov. 2025

Erklärung der Verwendung von JavaScripts document.location.

document.location ermöglicht es Ihnen, die URL der aktuellen Seite abzurufen oder die URL zu ändern.

Die Verwendung der origin-Methode erspart Ihnen den Aufwand der URL-Regex-Ersetzung.

document.location.href
"https://tpc.googlesyndication.com/safeframe/1-0-9/html/container.html"
document.location.origin
"https://tpc.googlesyndication.com"
document.location.pathname
"/safeframe/1-0-9/html/container.html"
document.location.host
"tpc.googlesyndication.com"
document.location.protocol
"https:"

Diesen Artikel teilen

Shou Arisaka 7. Nov. 2025

🔗 Links kopieren