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/tojson/index.html | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 files/ja/web/api/url/tojson/index.html (limited to 'files/ja/web/api/url/tojson') diff --git a/files/ja/web/api/url/tojson/index.html b/files/ja/web/api/url/tojson/index.html new file mode 100644 index 0000000000..4b9af2c147 --- /dev/null +++ b/files/ja/web/api/url/tojson/index.html @@ -0,0 +1,60 @@ +--- +title: URL.toJSON() +slug: Web/API/URL/toJSON +tags: + - API + - Method + - Reference + - URL + - toJSON + - toJSON() +translation_of: Web/API/URL/toJSON +--- +
{{APIRef("URL API")}}
+ +

{{domxref("URL")}} インターフェイスの toJSON() メソッドは、URL のシリアル化されたバージョンを含む {{domxref("USVString")}} を返しますが、実際には {{domxref("URL.toString()")}} と同じ効果があるようです。

+ +

(訳注:このメソッドは、{{jsxref("JSON.stringify()")}} メソッドが、このメソッドを持つオブジェクトを JSON 文字列に変換するために使います。)

+ +

{{AvailableInWorkers}}

+ +

構文

+ +
json = url.toJSON();
+ +

パラメーター

+ +

なし。

+ +

戻り値

+ +

{{domxref("USVString")}}。

+ +

+ +
const url = new URL("https://developer.mozilla.org/en-US/docs/Web/API/URL/toString");
+url.toJSON()
+
+ +

仕様

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

ブラウザーの互換性

+ + + +

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

-- cgit v1.2.3-54-g00ecf