<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script>
var windo = null;
function inWindow(){
windo = window.open("me.html");
}
function outWindow(){
if(windo != null) windo.close();
}
</script>
</head>
<body>
<form>
<input type="button" value="윈도우 open" onclick="inWindow()">
<input type="button" value="윈도우 exit" onclick="outWindow()">
<input type="button" value="내용 인쇄하기" onclick="window.print()">
</form>
</body>
</html>
window.print() 현재 창의 내용을 다른 창에서 프린트하기
window.open("url"); 새로운 윈도우창 열기
if(window != null) 널값이 아니라면(창이 없는 게 아니라면)
windo.close(); 창닫기
'개발일지 > JavaScript + jquery' 카테고리의 다른 글
[jquery] 다운로드 주의 사항 + 기본 사용법 (0) | 2021.09.10 |
---|---|
[js] canvas에 그림 그리기(선, 사각형, 삼각형, 글씨 등) (0) | 2021.09.10 |
[js] 타이머 setTimeout (0) | 2021.09.09 |
[js] 현재 날짜와 시간을 찍는 메소드 (0) | 2021.09.09 |
[js] frame 화면나누기 복습 및 홈페이지 연결 (0) | 2021.09.09 |