본문 바로가기

develop/java script

팝업창 띄우기

//팝업창 띄우기 전 쿠키 체크

if (getCookie("notice") != "done") {

noticeWindow  = window.open('/portal/jsp/popup/cho_EduPopup.jsp', 'eduPop', 'width=300, height=270,marginwidth=0,marginheight=0,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no');

noticeWindow.opener = self;

}


//쿠키 가져오기

function getCookie( name )

{

      var nameOfCookie = name + "=";

      var x = 0;

      while ( x <= document.cookie.length )

      {

              var y = (x+nameOfCookie.length);

              if ( document.cookie.substring( x, y ) == nameOfCookie ) {

                      if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )

                              endOfCookie = document.cookie.length;

                      return unescape( document.cookie.substring( y, endOfCookie ) );

              }

              x = document.cookie.indexOf( " ", x ) + 1;

              if ( x == 0 )

                      break;

      }

      return "";

   }

'develop > java script' 카테고리의 다른 글

JS 생성자?? 프로토 타입???  (0) 2015.02.05
checkbox tree list value 가져오기  (0) 2014.11.12
treeview  (0) 2014.11.11
리플 제한 및 글 개수 변화 스크립트  (0) 2014.11.05
JSON-lib Java Library  (0) 2014.11.03