From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- files/ko/web/api/url/searchparams/index.html | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 files/ko/web/api/url/searchparams/index.html (limited to 'files/ko/web/api/url/searchparams') diff --git a/files/ko/web/api/url/searchparams/index.html b/files/ko/web/api/url/searchparams/index.html new file mode 100644 index 0000000000..b80d80c4a6 --- /dev/null +++ b/files/ko/web/api/url/searchparams/index.html @@ -0,0 +1,56 @@ +--- +title: URL.searchParams +slug: Web/API/URL/searchParams +tags: + - API + - Property + - Read-only + - Reference + - URL + - URLSearchParams +translation_of: Web/API/URL/searchParams +--- +
{{APIRef("URL API")}}
+ +

{{domxref("URL")}} 인터페이스의 searchParams 읽기 전용 속성은 URL 내의 {{httpmethod("GET")}} 디코딩 된 쿼리 매개변수에 접근할 수 있는 {{domxref("URLSearchParams")}} 객체를 반환합니다.

+ +

{{AvailableInWorkers}}

+ +

구문

+ +
const urlSearchParams = url.searchParams
+ +

+ +

{{domxref("URLSearchParams")}} 객체.

+ +

예제

+ +

페이지의 URL을 https://example.com/?name=Jonathan%20Smith&age=18로 가정했을 때, nameage 매개변수는 다음과 같이 가져올 수 있습니다.

+ +
let params = (new URL(document.location)).searchParams;
+let name = params.get('name'); // is the string "Jonathan Smith".
+let age = parseInt(params.get('age')); // is the number 18
+ +

명세

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('URL', '#dom-url-searchparams', 'searchParams')}}{{Spec2('URL')}}Initial definition.
+ +

브라우저 호환성

+ + + +

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

-- cgit v1.2.3-54-g00ecf