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/history/go/index.html | 82 ++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 files/ko/web/api/history/go/index.html (limited to 'files/ko/web/api/history/go/index.html') diff --git a/files/ko/web/api/history/go/index.html b/files/ko/web/api/history/go/index.html new file mode 100644 index 0000000000..3f90100ea8 --- /dev/null +++ b/files/ko/web/api/history/go/index.html @@ -0,0 +1,82 @@ +--- +title: History.go() +slug: Web/API/History/go +translation_of: Web/API/History/go +--- +
{{APIRef("History API")}}
+ +

History.go() 메서드는 history 세션에서 특정한 페이지를 로딩합니다. 인자로 전달하는 파라미터 값에 따라 history를 통해서 페이지를 앞 뒤로 이동할 수 있습니다. 

+ +

이 메서드는 {{glossary("asynchronous")}}(비동기)로 동작합니다. 페이지 앞, 뒤 이동이 언제 이뤄지는지 알려면 {{event("popstate")}} event에 대한 listener를 등록합니다.

+ +

구문

+ +
history.go([delta])
+ +

Parameters

+ +
+
delta {{optional_inline}}
+
현재 페이지에서 상대적으로 이동하려고 하는 history의 위치 값. 음수 값은 뒤로 이동하고, 양수 값은 앞으로 이동합니다. 예를 들면 history.go(2) 는 현재 페이지에서 2 페이지 앞으로 이동하고, history.go(-2) 는 현재 페이지에서 2 페이지 뒤로 이동합니다. 만약 값을 전달하지 않거나, delta 값을 0으로 전달한다면, 이는 location.reload()를 동작시켰을 때와 동일한 결과를 보입니다. (새로고침)
+
+ +

예제

+ +

한 페이지 뒤로 가기 ({{domxref("History.back", "back()")}}를 호출한 것과 동일):

+ +
history.go(-1)
+ +

{{domxref("History.forward", "forward()")}}와 동일한 한 페이지 앞으로 가기:

+ +
history.go(1)
+ +

두 페이지 앞으로 가기:

+ +
history.go(2);
+ +

두 페이지 뒤로 가기:

+ +
history.go(-2);
+ +

마지막으로, 아래 구문들은 현재 페이지를 새로고침 합니다:

+ +
history.go();
+history.go(0);
+ +

명세

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("HTML WHATWG", "history.html#dom-history-go", "History.go()")}}{{Spec2("HTML WHATWG")}}No change from {{SpecName("HTML5 W3C")}}.
{{SpecName("HTML5 W3C", "browsers.html#dom-history-go", "History.go()")}}{{Spec2("HTML5 W3C")}}Initial definition.
+ +

브라우저 호환성

+ + + +

{{Compat("api.History.go")}}

+ +

See also

+ + -- cgit v1.2.3-54-g00ecf