WEB.JS/07.BOM_JS

chapter04 : history

GAWON 2023. 5. 22. 09:17
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
/*
history : 웹 페이지 상단의<, > 화살표
입력된 양식이 삭제되지 않고 유지되기 때문에(캐시가 가능한 경우) 여러 페이지 등에서 사용
*/

```
//1.뒤로가기
history.back();  //history.go(-1) 동일

//2.앞으로 가기
history.forward();  //history.go(1) 동일

//3.이전 페이지로 가기
history.go(-1);  //주로 사용한다  :()안에 숫자마다 그 페이지로 이동가능

//4.이전 이전 페이지로 가기
history.go(-2);

```

</script>
</head>
<body>

</body>
</html>