From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/url/host/index.html | 68 ++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 files/ja/web/api/url/host/index.html (limited to 'files/ja/web/api/url/host/index.html') diff --git a/files/ja/web/api/url/host/index.html b/files/ja/web/api/url/host/index.html new file mode 100644 index 0000000000..1c8a57f786 --- /dev/null +++ b/files/ja/web/api/url/host/index.html @@ -0,0 +1,68 @@ +--- +title: URL.host +slug: Web/API/URL/host +tags: + - API + - Host + - Property + - Reference + - URL +translation_of: Web/API/URL/host +--- +
{{ApiRef("URL API")}}
+ +

{{domxref("URL")}} インターフェイスの host プロパティは、ホストを含む {{domxref("USVString")}} です。 ホストは、ホスト名の後に、URL のポートが空でない場合、':'、および URL のポートが続きます。

+ +

{{AvailableInWorkers}}

+ +

構文

+ +
string = object.host;
+object.host = string;
+
+ +

+ +

{{domxref("USVString")}}。

+ +

+ +
var url = new URL('https://developer.mozilla.org/en-US/docs/Web/API/URL/host');
+var result = url.host // "developer.mozilla.org"
+
+var url = new URL('https://developer.mozilla.org:443/en-US/docs/Web/API/URL/host');
+var result = url.host // "developer.mozilla.org"
+// 443 がスキームのデフォルトポートであるため、ポート番号は含まれません
+
+var url = new URL('https://developer.mozilla.org:4097/en-US/docs/Web/API/URL/host');
+var result = url.host // "developer.mozilla.org:4097"
+
+ +

仕様

+ + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('URL', '#dom-url-host', 'URL.host')}}{{Spec2('URL')}}初期定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.URL.host")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf