Contoh
Mengembalikan nama jalan dari URL saat ini:
var x = location.pathname;
Hasil x akan:
Cobalah sendiri " Definisi dan Penggunaan
Pathname set properti atau mengembalikan pathname dari URL.
Dukungan Browser
Milik | |||||
---|---|---|---|---|---|
pathname | iya nih | iya nih | iya nih | iya nih | iya nih |
Sintaksis
Kembali properti path:
location.pathname
Mengatur properti path:
location.pathname= path
Nilai properti
Value | Type | Description |
---|---|---|
path | String | Specifies the pathname of the URL |
Rincian teknis
Kembali Nilai: | Sebuah String, yang mewakili pathname |
---|
