Emplacement de la fenêtre.pathname
Exemple
Obtenez le chemin actuel :
let path x = location.pathname;
Définition et utilisation
La pathname
propriété définit ou renvoie le chemin d'accès d'une URL (page).
Syntaxe
Renvoyez la propriété pathname :
location.pathname
Définissez la propriété pathname :
location.pathname = path
Valeurs de propriété
Parameter | Description |
path | The pathname of the URL. |
Valeur de retour
Taper | La description |
Un string | Le chemin d'accès actuel. |
Prise en charge du navigateur
location.pathname
est pris en charge dans tous les navigateurs :
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |