ตำแหน่งหน้าต่าง.ชื่อเส้นทาง
ตัวอย่าง
รับเส้นทางปัจจุบัน:
let path x = location.pathname;
ความหมายและการใช้งาน
คุณสมบัติpathname
ตั้งค่าหรือส่งคืนชื่อพาธของ URL (เพจ)
ไวยากรณ์
ส่งคืนคุณสมบัติชื่อพาธ:
location.pathname
ตั้งค่าคุณสมบัติชื่อพาธ:
location.pathname = path
มูลค่าทรัพย์สิน
Parameter | Description |
path | The pathname of the URL. |
คืนมูลค่า
พิมพ์ | คำอธิบาย |
สตริง | ชื่อพาธปัจจุบัน |
รองรับเบราว์เซอร์
location.pathname
รองรับในทุกเบราว์เซอร์:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |