Comment - Obtenir l'URL actuelle avec JavaScript
Découvrez comment obtenir l'URL actuelle avec JavaScript.
URL actuelle
Utilisez window.location.href
pour obtenir l'adresse URL actuelle :
Exemple
document.getElementById("demo").innerHTML =
"The full URL of this page
is:<br>" + window.location.href;
En savoir plus sur l' window.location
objet dans notre didacticiel sur l'emplacement des fenêtres JavaScript .