반응형
페이지 이동
페이지를 이동하게 하는 명령어이다.
location.href= "이동할 페이지";
예시
<script type = "text/javascript">
function a(path){
location.href = path; //파람으로 받은 페이지로 이동
}
</script>
<body>
<input type = "button" name = "b1" value = "1페이지로 이동" onclick = "a('1.html')">
<input type = "button" value = "2페이지로 이동" onclick = "a('2.html')">
</body>
반응형