17.12.15 웹3일차

자바스크립트 이벤트 처리

이벤트란

====== 버튼 처리 문법

<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>

<input type=button value=pop id=popBtn>


<script type="text/javascript">

document.getElementById("popBtn").onclick = function(){
 alert("pop");
}

</script>

</body>
</html>

====== 페이지 이동문법

<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>

<input type=button value=pop id=popBtn>


<script type="text/javascript">

document.getElementById("popBtn").onclick = function(){
 location.href = "http://www.naver.com"; //페이지 이동문법
  
}

</script>

</body>
</html>


========= 버튼 클릭 후 페이지 팝업 사이즈 지정
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>

<input type=button value=pop id=popBtn>


<script type="text/javascript">

document.getElementById("popBtn").onclick = function(){

 window.open("http://www.naver.com","","width=500,heigt=500");
  
}

</script>

</body>
</html>

======

<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>

<script type="text/javascript">

window.onload = function(){
 
 window.open("http://www.google.com","","width=500,height=500");
}

</script>
</body>
</html>

=====

<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>

<script type="text/javascript">

window.onunload = function(){
 for(var i = 0;i<5;i++){
 
 
 window.open("http://www.google.com","","width=500,height=500");
}
}

</script>
</body>
</html>
=======

 

========================== jsp 시작


jsp

서블릿은 문서를 요청받으면 바로 만들어서 보냄

 


 

 

+ Recent posts