aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/api/history/back/index.html
blob: 2b5ee8475a71163e7f322b5967dc26b5396d87e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
title: History.back()
slug: Web/API/History/back
tags:
  - API
  - HTML DOM
  - History
  - History API
  - Method
  - Reference
  - Web
translation_of: Web/API/History/back
---
<div>{{APIRef("DOM")}}</div>

<p><span class="seoSummary"><strong><code>History.back()</code></strong> 메서드는 브라우저가 세션 기록의 바로 뒤 페이지로 이동하도록 지시합니다.</span> {{domxref("History.go", "history.go(-1)")}}와 같습니다. 이전 페이지가 없는 경우 아무것도 하지 않습니다.</p>

<p>이 메서드는 비동기적입니다. {{event("popstate")}} 이벤트 처리기를 통해 탐색 완료 시점을 알 수 있습니다.</p>

<h2 id="구문">구문</h2>

<pre class="syntaxbox">history.back()</pre>

<h2 id="예제">예제</h2>

<p>다음 예제는 클릭했을 때 뒤로 가는 버튼을 생성합니다.</p>

<h3 id="HTML">HTML</h3>

<pre class="brush: html">&lt;button id="go-back"&gt;뒤로 가기!&lt;/button&gt;</pre>

<h3 id="JavaScript">JavaScript</h3>

<pre class="brush: js">document.getElementById('go-back').addEventListener('click', () =&gt; {
  window.history.back();
});</pre>

<h2 id="명세">명세</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName("HTML WHATWG", "history.html#history", "History.back()")}}</td>
   <td>{{Spec2("HTML WHATWG")}}</td>
   <td>No change from {{SpecName("HTML5 W3C")}}.</td>
  </tr>
  <tr>
   <td>{{SpecName("HTML5 W3C", "browsers.html#dom-history-back", "History.back()")}}</td>
   <td>{{Spec2("HTML5 W3C")}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="브라우저_호환성">브라우저 호환성</h2>



<p>{{Compat("api.History.back")}}</p>

<h2 id="같이_보기">같이 보기</h2>

<ul>
 <li>{{domxref("History")}}</li>
</ul>