diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
commit | da78a9e329e272dedb2400b79a3bdeebff387d47 (patch) | |
tree | e6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/ko/web/api/urlsearchparams/tostring | |
parent | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff) | |
download | translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2 translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip |
initial commit
Diffstat (limited to 'files/ko/web/api/urlsearchparams/tostring')
-rw-r--r-- | files/ko/web/api/urlsearchparams/tostring/index.html | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/files/ko/web/api/urlsearchparams/tostring/index.html b/files/ko/web/api/urlsearchparams/tostring/index.html new file mode 100644 index 0000000000..45f0373dec --- /dev/null +++ b/files/ko/web/api/urlsearchparams/tostring/index.html @@ -0,0 +1,78 @@ +--- +title: URLSearchParams.toString() +slug: Web/API/URLSearchParams/toString +translation_of: Web/API/URLSearchParams/toString +--- +<p>{{ApiRef("URL API")}}</p> + +<p><strong><code>toString()</code> </strong>은 {{domxref("URLSearchParams")}} 인터페이스의 메소드로서, URL에서 사용할 수 있는 쿼리 문자열을 리턴합니다.</p> + +<div class="blockIndicator note"> +<p><strong>Note</strong>: 이 메소드는 물음표가 없는 쿼리 문자열을 리턴합니다. 이는 물음표를 포함하여 리턴하는 <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/search">window.location.search</a>와는 다른 부분입니다.</p> +</div> + +<p>{{availableinworkers}}</p> + +<h2 id="Syntax">Syntax</h2> + +<pre class="syntaxbox">URLSearchParams.toString()</pre> + +<h3 id="Parameters">Parameters</h3> + +<p>None.</p> + +<h3 id="Return_value">Return value</h3> + +<p>A {{domxref("DOMString")}}, without the question mark.</p> + +<h2 id="Examples">Examples</h2> + +<pre class="brush: js">let url = new URL('https://example.com?foo=1&bar=2'); +let params = new URLSearchParams(url.search.slice(1)); + +//두번째 foo 파라미터를 추가합니다. +params.append('foo', 4); +console.log(params.toString()); +//'foo=1&bar=2&foo=4'를 출력합니다. + +// note: params can also be directly created +let url = new URL('https://example.com?foo=1&bar=2'); +let params = url.searchParams; + +// or even simpler +let params = new URLSearchParams('foo=1&bar=2'); +</pre> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('URL', '#interface-urlsearchparams', "toString() (see \"stringifier\")")}}</td> + <td>{{Spec2('URL')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + +<div> + + +<p>{{Compat("api.URLSearchParams.toString")}}</p> +</div> + +<h2 id="See_also">See also</h2> + +<ul> + <li>The {{domxref("URL")}} interface.</li> + <li><a href="https://developers.google.com/web/updates/2016/01/urlsearchparams?hl=en">Google Developers: Easy URL manipulation with URLSearchParams</a></li> +</ul> |