ပြတင်းပေါက်တည်နေရာ
Window Location Object ၊
တည်နေရာအရာဝတ္တု တွင် လက်ရှိ URL နှင့်ပတ်သက်သည့် အချက်အလက်ပါရှိသည်။
တည်နေရာအရာဝတ္တု သည် ဝင်းဒိုးအရာဝတ္ထု ၏ ပိုင်ဆိုင်မှုတစ်ခုဖြစ်သည် ။
တည်နေရာအရာဝတ္တု အား ဝင်ရောက်အသုံးပြုသည်-
window.location
သို့မဟုတ်ရုံlocation
ဥပမာများ
let origin = window.location.origin;
let origin = location.origin;
တည်နေရာ Object Properties
Property | Description |
---|---|
hash | Sets or returns the anchor part (#) of a URL |
host | Sets or returns the hostname and port number of a URL |
hostname | Sets or returns the hostname of a URL |
href | Sets or returns the entire URL |
origin | Returns the protocol, hostname and port number of a URL |
pathname | Sets or returns the path name of a URL |
port | Sets or returns the port number of a URL |
protocol | Sets or returns the protocol of a URL |
search | Sets or returns the querystring part of a URL |
တည်နေရာအရာဝတ္ထုနည်းလမ်းများ
Method | Description |
---|---|
assign() | Loads a new document |
reload() | Reloads the current document |
replace() | Replaces the current document with a new one |