Esempio
Restituisce il nome percorso della URL corrente:
var x = location.pathname;
Il risultato di x sarà:
Prova tu stesso " Definizione e utilizzo
Gli insiemi di proprietà di percorso o restituisce il percorso di un URL.
Supporto per il browser
Proprietà | |||||
---|---|---|---|---|---|
pathname | sì | sì | sì | sì | sì |
Sintassi
Restituisce la proprietà percorso:
location.pathname
Impostare la proprietà percorso:
location.pathname= path
I valori delle proprietà
Value | Type | Description |
---|---|---|
path | String | Specifies the pathname of the URL |
Dettagli tecnici
Valore di ritorno: | Una stringa, che rappresenta il percorso |
---|
