● window.open()
페이지 정보
본문
<script>
var win = null;
function show(){
if(win == null || win.closed){
win = window.open("","outWin","width=300, height=300");
}else{
alert("멀 그리 눌러 샀노. 팝업 열려 있다.");
}
var textArea = document.getElementById("srcText");
win.document.open();
win.document.write(textArea.value);
win.document.close();
}
</script>
<body>
<h3></h3>
<hr>
textarea 태그 안에 내용을 작성 하시고 [문서 출력]버튼을 눌러보세요.
<br>
<textarea id="srcText" rows=10 cols=50></textarea>
<br>
<button onclick="show()">문서 출력</button>
<button onclick="window.open('aaa.html','','width=400,height=400,left=0,top=0');" style="cursor:pointer;">팝업 클릭1</button>
<button onclick="window.open('bbb.html?id=dancepkt','aaa','width=400,height=400,left=0,top=0');" style="cursor:pointer;">팝업 클릭1</button>
==== tip ====
window.open("웹페이지 url","윈도우 이름","윈도우 속성");
- 이전글▶ 1~100 랜덤 수 맞추기 21.07.18
- 다음글● document객체의 프로퍼티 21.07.18
댓글목록
등록된 댓글이 없습니다.