Jsp - 창열기,닫기

2020. 6. 16. 10:43Jsp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
//     웹브라우저 내장객체
//     window(창) - location(주소줄)
//                     - history(방문기록)
//                     - document(html문서) ->image,link,layer...
//                                                                 - form(로그인창)->text,password,textarea
//                                                                 -checkbox, radio
//                                                                 -select - option
// window내장객체 ->변수status,opener(창을 열었던기록),        함수open(),close()
//                    내장객체.변수        내장객체.함수()
//                    window.변수status()             window.함수open()            window.함수close()
function fun1() {
//     window.open("창열때 열리는 주소,문서이름","창이름","창크기(width,height,...),위치(left,top,...)",scrollbars(스크롤바),resizable(창크기조절),....);
        window.open("http://www.naver.com","창이름","width=200,height=100,left=100,top=100,scrollbars=yes,resizable=yes");
}
//함수 fun2() 창열기 test1_2.html 문서열기
function fun2() {
    window.open("http://localhost:8080/Study_JSP/js2/test1_2.html","창이름","width=300,height=200");
    
}
function fun3() {
    //창닫기
    window.close();
}
</script>
</head>
<body>
<h1>js2/test1.html</h1>
<input type="button" value="창열기" onclick="fun1()">
<input type="button" value="창열기2" onclick="fun2()">
<input type="button" value="창닫기" onclick="fun3()">
</body>
</html>
 
cs

 

 

창을 열고 닫는 방법을 배워보았다. 간단간단하게 넘어가 보자.

'Jsp' 카테고리의 다른 글

Jsp - 페이지 이동  (0) 2020.06.16
Jsp - 주소확인  (0) 2020.06.16
Jsp - 화면4  (0) 2020.06.16
Jsp - 화면3  (0) 2020.06.16
Jsp - 화면 2  (0) 2020.06.16