aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/api/history/forward/index.html
blob: 52ab61f70be216ea5153a8ceb747d084ad8c36af (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
---
title: History.forward()
slug: Web/API/History/forward
tags:
  - API
  - HTML DOM
  - History
  - History API
  - Method
  - Reference
translation_of: Web/API/History/forward
---
<div>{{APIRef("DOM")}}</div>

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

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

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

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

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

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

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

<pre class="brush: html">&lt;button id='go-forward'&gt;앞으로 가기!&lt;/button&gt;</pre>

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

<pre class="brush: js line-numbers language-js"><code class="language-js">document<span class="punctuation token">.</span><span class="function token">getElementById</span><span class="punctuation token">(</span><span class="string token">'go-forward'</span><span class="punctuation token">)</span><span class="punctuation token">.</span><span class="function token">addEventListener</span><span class="punctuation token">(</span><span class="string token">'click'</span><span class="punctuation token">,</span> <span class="parameter token">e</span> <span class="operator token">=&gt;</span> <span class="punctuation token">{</span>
  window<span class="punctuation token">.</span>history<span class="punctuation token">.forward</span><span class="punctuation token">(</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
<span class="punctuation token">}</span><span class="punctuation token">)</span></code></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", "browsers.html#history", "History")}}</td>
   <td>{{Spec2("HTML WHATWG")}}</td>
   <td>No change from {{SpecName("HTML5 W3C")}}.</td>
  </tr>
  <tr>
   <td>{{SpecName("HTML5 W3C", "browsers.html#history", "History")}}</td>
   <td>{{Spec2("HTML5 W3C")}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

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



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

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

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