ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • JavaScript
    GUI/Window 2010. 7. 12. 11:43
    confirm()


    window.open("URL","창이름","옵션");

    옵션:
    top : 새창의 y좌표
    width : 새창의 가로
    height : 새창의 세로
    menubar : 파일, 편집, 보기 등의 버튼이 있는 줄
    toolbar : 뒤로, 앞으로, 검색, 즐겨찾기 등의 버튼이 나오는 줄
    location : 주소창
    scrollbars : 스크롤바
    status : 창 아래부분 링크주소 나오는 부분
    resizable : 창의 크기를 조절 가능 여부
    fullscreen : 최대화 창으로 띄움( 이 옵션을 쓰게 되면 width,height,top,left 옵션이 적용안됨)


    // 크기

    var x,y;
    if (self.innerHeight) { // IE 외 모든 브라우저
        x = self.innerWidth;
        y = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict 모드
        x = document.documentElement.clientWidth;
        y = document.documentElement.clientHeight;
    }
    else if (document.body) { // 다른 IE 브라우저
        x = document.body.clientWidth;
        y = document.body.clientHeight;
    }


    // 경고창 없이 닫기

    if (/MSIE/.test(navigator.userAgent)) {
       //Explorer 7이상일때
       if(navigator.appVersion.indexOf("MSIE 7.0")>=0) {
          window.open('about:blank','_self').close();
       }
       //Explorer 7이하일때
       else {
          window.opener = self;
          self.close();
       }
    }


    참조 사이트:

Designed by Tistory.