Window location.hostname
ဥပမာ
လက်ရှိ URL ၏ hostname ကို ပြန်ပေးပါ။
let hostname = location.hostname;
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ပိုင်ဆိုင်မှုသည် URL တစ်ခု၏ location.hostname
host (IP လိပ်စာ သို့မဟုတ် ဒိုမိန်း) ကို ပြန်ပေးသည်။
hostname အသစ်တစ်ခုဖြင့် တူညီသော location.hostname
URL သို့ သွားရန်အတွက်လည်း ပိုင်ဆိုင်မှုကို သတ်မှတ်နိုင်သည်။
အထားအသို
လက်ခံသူအမည် ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ။
location.hostname
လက်ခံသူအမည် ပိုင်ဆိုင်မှုကို သတ်မှတ်ပါ-
location.hostname = hostname
အိမ်ခြံမြေတန်ဖိုး
Value | Description |
hostname | The hostname of the URL. |
တန်ဖိုးကို ပြန်ပေးသည်။
ရိုက်ပါ။ | ဖော်ပြချက် |
ကြိုးတစ်ချောင်း | URL တစ်ခု၏ host (IP လိပ်စာ သို့မဟုတ် ဒိုမိန်း)။ |
Browser ပံ့ပိုးမှု
location.hostname
ဘရောက်ဆာအားလုံးတွင် ထောက်ခံသည်-
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |