프레임(frame)도 창(window)란 점을 이해해야 한다.
[사용방법]
w = window.open(url, target, parameter)
o url : 새 창 또는 특정 프레임에 열릴 문서의 URL
o target : 새 창 또는 특정 프레임의 이름
<A>태그에 있는 target속성에서 지시되는 이름
이미 열려있는 창이나 프레임이 있는 경우 그 창이나 프레임에 URL이 열리며,
target과 같은 창이나 프레임이 없는 경우 새 창에 열림
o parameter : 새로 열리는 창의 모양을 결정하는 매개 변수 목록으로 " "안에 다음 내용을 씀
생략하면 기본값
left=40(왼쪽위치), top=40(위쪽위치), width=300(너비), height=300(높이),
directories=0(디렉토리버튼), scrollbars=1(스크롤바), resizable=1(크기조절),
status=0(상태표시줄), location=0(주소), menubar=0(메뉴),
channelmode(채널모드), fullscreen(전체화면)
o w : window,open으로 열거나 참조되는 창(또는 프레임)을 의미하는 개체 변수
w 는 변수이름이므로 다르게 써도 관계 없음
예시 1
win = window.open('http://kr.yahoo.com', 'w2', 'left=40, top=40, width=300, height=300,
directories=0, scrollbars=1, resizable=1,
status=0, location=0, menubar=0');
win.focus();
예시 2
m = window.open('http://kr.yahoo.com', 't3', 'channelmode, scrollbars');
m.focus();
win.close();
출처 : http://blog.naver.com/hjunki?Redirect=Log&logNo=100013967171