aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/api/location/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:17 -0500
commitda78a9e329e272dedb2400b79a3bdeebff387d47 (patch)
treee6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/ko/web/api/location/index.html
parent1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff)
downloadtranslated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz
translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2
translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip
initial commit
Diffstat (limited to 'files/ko/web/api/location/index.html')
-rw-r--r--files/ko/web/api/location/index.html112
1 files changed, 112 insertions, 0 deletions
diff --git a/files/ko/web/api/location/index.html b/files/ko/web/api/location/index.html
new file mode 100644
index 0000000000..42587a8572
--- /dev/null
+++ b/files/ko/web/api/location/index.html
@@ -0,0 +1,112 @@
+---
+title: Location
+slug: Web/API/Location
+tags:
+ - API
+ - HTML DOM
+ - Interface
+ - Location
+ - Reference
+translation_of: Web/API/Location
+---
+<div>{{APIRef("HTML DOM")}}</div>
+
+<p><span class="seoSummary"><strong><code>Location</code></strong> 인터페이스는 객체가 연결된 장소(URL)를 표현합니다.</span> <code>Location</code> 인터페이스에 변경을 가하면 연결된 객체에도 반영되는데, {{domxref("Document")}}와 {{domxref("Window")}} 인터페이스가 이런 <code>Location</code>을 가지고 있습니다. 각각 {{domxref("Document.location")}}과 {{domxref("Window.location")}}으로 접근할 수 있습니다.</p>
+
+<h2 id="속성">속성</h2>
+
+<p><code>Location</code> 인터페이스는 아무 속성도 상속하지 않지만, {{domxref("URLUtils")}}의 속성을 구현합니다.</p>
+
+<dl>
+ <dt>{{domxref("Location.href")}}</dt>
+ <dd>온전한 URL을 값으로 하는 {{domxref("DOMString")}}입니다. 바뀔 경우 연결된 문서도 새로운 페이지로 이동합니다. 연결된 문서와 다른 오리진에서도 설정할 수 있습니다.</dd>
+ <dt>{{domxref("Location.protocol")}}</dt>
+ <dd>URL의 프로토콜 부분을 값으로 하는 {{domxref("DOMString")}}으로, 마지막의 <code>':'</code>도 포함합니다.</dd>
+ <dt>{{domxref("Location.host")}}</dt>
+ <dd>URL의 호스트 부분을 값으로 하는 {{domxref("DOMString")}}으로, 호스트명, <code>':'</code>, 포트 번호를 포함합니다.</dd>
+ <dt>{{domxref("Location.hostname")}}</dt>
+ <dd>URL의 도메인 부분을 값으로 하는 {{domxref("DOMString")}}입니다.</dd>
+ <dt>{{domxref("Location.port")}}</dt>
+ <dd>URL의 포트 번호를 값으로 하는 {{domxref("DOMString")}}입니다.</dd>
+ <dt>{{domxref("Location.pathname")}}</dt>
+ <dd><code>'/'</code> 문자 뒤 URL의 경로를 값으로 하는 {{domxref("DOMString")}}입니다.</dd>
+ <dt>{{domxref("Location.search")}}</dt>
+ <dd><code>'?'</code> 문자 뒤 URL의 쿼리스트링을 값으로 하는 {{domxref("DOMString")}}입니다. 모던 브라우저에서는 {{domxref("URLSearchParams.get()")}}과 {{domxref("URL.searchParams")}}를 사용해서 인자를 쉽게 추출할 수 있습니다.</dd>
+ <dt>{{domxref("Location.hash")}}</dt>
+ <dd><code>'#'</code> 문자 뒤 URL의 프래그먼트 식별자를 값으로 하는 {{domxref("DOMString")}}입니다.</dd>
+ <dt>{{domxref("Location.username")}}</dt>
+ <dd>도메인 이름 이전에 명시된 사용자명을 값으로 하는 {{domxref("DOMString")}}입니다.</dd>
+ <dt>{{domxref("Location.password")}}</dt>
+ <dd>도메인 이름 이전에 명시된 비밀번호를 값으로 하는 {{domxref("DOMString")}}입니다.</dd>
+ <dt>{{domxref("Location.origin")}} {{readOnlyInline}}</dt>
+ <dd>지정한 장소 오리진의 표준 형태를 값으로 하는 {{domxref("DOMString")}}입니다.</dd>
+</dl>
+
+<h2 id="메서드">메서드</h2>
+
+<p><code>Location</code> 인터페이스는 아무 메서드도 상속하지 않지만, {{domxref("URLUtils")}}의 메서드를 구현합니다.</p>
+
+<dl>
+ <dt>{{domxref("Location.assign()")}}</dt>
+ <dd>주어진 URL의 리소스를 불러옵니다.</dd>
+ <dt>{{domxref("Location.reload()")}}</dt>
+ <dd>현재 URL의 리소스를 다시 불러옵니다. 선택적으로 매개변수에 <code>true</code>를 제공해 브라우저 캐시를 무시하고 서버에서 새로 불러올 수 있습니다,</dd>
+ <dt>{{domxref("Location.replace()")}}</dt>
+ <dd>Replaces the current resource with the one at the provided URL. The difference from the <code>assign()</code> method is that after using <code>replace()</code> the current page will not be saved in session {{domxref("History")}}, meaning the user won't be able to use the <em>back</em> button to navigate to it.</dd>
+ <dt>{{domxref("Location.toString()")}}</dt>
+ <dd>Returns a {{domxref("DOMString")}} containing the whole URL. It is a synonym for {{domxref("URLUtils.href")}}, though it can't be used to modify the value.</dd>
+</dl>
+
+<h2 id="예제">예제</h2>
+
+<pre class="brush: js">// Create anchor element and use href property for the purpose of this example
+// A more correct alternative is to browse to the URL and use document.location or window.location
+var url = document.createElement('a');
+url.href = 'https://developer.mozilla.org:8080/en-US/search?q=URL#search-results-close-container';
+console.log(url.href); // https://developer.mozilla.org:8080/en-US/search?q=URL#search-results-close-container
+console.log(url.protocol); // https:
+console.log(url.host); // developer.mozilla.org:8080
+console.log(url.hostname); // developer.mozilla.org
+console.log(url.port); // 8080
+console.log(url.pathname); // /en-US/search
+console.log(url.search); // ?q=URL
+console.log(url.hash); // #search-results-close-container
+console.log(url.origin); // https://developer.mozilla.org:8080
+</pre>
+
+<h2 id="명세">명세</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('HTML WHATWG', "browsers.html#the-location-interface", "Location")}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td>No change from {{SpecName("HTML5 W3C")}}.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5 W3C', "browsers.html#the-location-interface", "Location")}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+
+
+<p>{{Compat("api.Location")}}</p>
+
+<h2 id="같이_보기">같이 보기</h2>
+
+<ul>
+ <li>Two methods creating such an object: {{domxref("Window.location")}} and {{domxref("Document.location")}}.</li>
+ <li>URL related interfaces: {{domxref("URL")}}, {{domxref("URLSearchParams")}} and {{domxref("HTMLHyperlinkElementUtils")}}</li>
+</ul>