브라우저 객체모델

Javascript&Jquery 2012. 2. 17. 16:44
syntax highlighter 쓸려면 html 창에서 요거 입력해주고 다시 돌아와서 쓰면 됨
<PRE style="WIDTH: 600px; HEIGHT: 486px" class="brush: php; highlight: [5, 15]; html-script:true"></pre>

윈도우하나 창 띄우기
window.open('http://hanb.co.kr', 'child', 'width=600, height=300', true);

윈도우 하나 창 띄우면서 그 창에 글씨(From Parent Window) 있어

//변수를 선언
var child = window.open('', '', 'width=300, height=200');
//출력
child.document.write('<h1>From Parent Window</h1>');


만약 팝업창 차단이 되어있어 내용을 볼수없다면 alert 을 넣어주자

 //변수를 선언
 var child = window.open('', '', 'width=300, height=200'); 
 //출력
 if (child) {
  child.document.write('<h1>Frome Parent Window</h1>');
  } else {
   alert('팝업 차단을 해제해 주세요.');
  }
posted by 알 수 없는 사용자