Notice
Recent Posts
Recent Comments
관리 메뉴

Developer Gonie

[8주차] 32. history 객체의 go() 메소드(feat. back(),forward() 메소드) 뒤로가기, 앞으로가기 본문

K-DigitalTraining 강의/6. Javascript(웹표준)

[8주차] 32. history 객체의 go() 메소드(feat. back(),forward() 메소드) 뒤로가기, 앞으로가기

이대곤 2022. 7. 9. 17:11

동일코드

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<h2>세번째 페이지</h2>
	
	<a href="first.html"><img src="images/01.gif"></a>
	<a href="second.html"><img src="images/02_s.gif"></a>
	
	<img src="images/03_s.gif">
	
	<a href="fourth.html"><img src="images/04_s.gif"></a>
	
	<br>
	<br>
	
	<input type="button" value="이전 페이지로" onClick="history.go(-1)">
	<input type="button" value="다음 페이지로" onClick="history.go(1)">
	<br>
	<br>
	<!-- back() == go(-1), forward() == go(1) 웹브라우저의 화살표와 기능이 같음 -->
	<input type="button" value="이전 페이지로" onClick="history.back()">
	<input type="button" value="다음 페이지로" onClick="history.forward()">
	<br>
	<br>
	<input type="button" value="이전이전 페이지로" onClick="history.go(-2)">
	<input type="button" value="다음다음 페이지로" onClick="history.go(2)">
</body>
</html>
Comments