공부자료/자바스크립트
새창 띄우기, 창 닫기
MIS경영정보
2013. 8. 21. 11:04
반응형
링크를 클릭할 때 새창 띄우기
자바스크립트 이용
〈a href="javascript:void(window.open('주소','팝업이름','width=가로,height=세로'))"〉Link〈/a〉
온클릭 이용
〈a href="#" onClick="window.open('주소','팝업이름','width=가로,height=세로');return false"〉Link〈/a〉
버튼을 클릭할 때 새창 띄우기
〈input type="button" value="JSGUIDE" onClick="window.open('주소','팝업이름','width=가로,height=세로')"〉
페이지 로딩이 완료되면 새창 띄우기
〈BODY onLoad="window.open('주소','팝업이름','width=가로,height=세로')"〉
무조건 새창 띄우기
〈script langauge="javascript"〉
window.open("주소","팝업이름","width=가로,height=세로");
〈/script〉
몇 초 후에 새창 띄우기
〈script langauge="javascript"〉
setTimeout("window.open('주소','팝업이름','width=가로,height=세로')",5000); //1000 = 1초
〈/script〉
창닫기
<a href = "javascript:self.close();">