定義と使用法
ホスト名のプロパティセットやURLのホスト名を返します。
ブラウザのサポート
プロパティ | |||||
---|---|---|---|---|---|
hostname | はい | はい | はい | はい | はい |
構文
ホスト名のプロパティを返します:
location.hostname
ホスト名のプロパティを設定します。
location.hostname= hostname
プロパティ値
Value | Type | Description |
---|---|---|
hostname | String | Specifies the hostname of the URL |
技術的詳細
戻り値: | ドメイン名を表す文字列、またはURLのIPアドレス |
---|
