posted by 네코냥이 2013. 1. 24. 13:44

출처: http://blog.naver.com/papaya5rhw/30156672046

# 키 이벤트

'keydown'

'keypress'

'keyup'



# JQuery에서 사용법


$('#id').keydown(function(e){


$('#id').val(''); //키다운시 공백처리

var key = e.keyCode; //키값


});


# 일반 태그에 이벤트 주기

<INPUT TYPE="text" NAME="asdf" onKeyDown="keyEvent()">


function keyEvent(){


var a = event.keyCode


alert(a);


}


# 일반 태그에 이벤트 주기_응용편

<INPUT TYPE="text" NAME="asdf" onKeyDown="javascript:if(event.keyCode=='13')keyEvent();return  false;">


posted by 네코냥이 2013. 1. 23. 13:46

# 함수원형

function setCookie( cookieName, cookieValue, expireDate )

 {

  var today = new Date();

  today.setDate( today.getDate() + parseInt( expireDate ) );

  document.cookie = cookieName + "=" + escape( cookieValue ) + "; path=/; expires=" + today.toGMTString() + ";";  // path 옵션을 주지 않으면, 쿠키가 저장되는 위치가 독립적이다.

 }



# 사용법

var date = new Date();

date.setDate(date.getDate() + 1);

setCookie("Alert_AutoSetting","1", date) ;




posted by 네코냥이 2013. 1. 23. 13:41

function getCookie( cookieName )

 {

  var search = cookieName + "=";

  var cookie = document.cookie;


  // 현재 쿠키가 존재할 경우

  if( cookie.length > 0 )

  {

   // 해당 쿠키명이 존재하는지 검색한 후 존재하면 위치를 리턴.

   startIndex = cookie.indexOf( cookieName );


   // 만약 존재한다면

   if( startIndex != -1 )

   {

    // 값을 얻어내기 위해 시작 인덱스 조절

    startIndex += cookieName.length;


    // 값을 얻어내기 위해 종료 인덱스 추출

    endIndex = cookie.indexOf( ";", startIndex );


    // 만약 종료 인덱스를 못찾게 되면 쿠키 전체길이로 설정

    if( endIndex == -1) endIndex = cookie.length;


    // 쿠키값을 추출하여 리턴

    return unescape( cookie.substring( startIndex + 1, endIndex ) );

   }

   else

   {

    // 쿠키 내에 해당 쿠키가 존재하지 않을 경우

    return false;

   }

  }

  else

  {

   // 쿠키 자체가 없을 경우

   return false;

  }

 }


posted by 네코냥이 2013. 1. 23. 13:34



function getQuerystring(key, default_)     // 받을 문자열, 없을시 기본값

        {

          if (default_==null) default_="" 

          key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");

          var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");

          var qs = regex.exec(window.location.href);

          if(qs == null)

            return default_;

          else

            return qs[1];

        }



posted by 네코냥이 2013. 1. 22. 19:44


바로 이 컨트롤러를 이용하면 쉽다

Panel Class

 Visible 속성을 가지고 False True값을 주면 된다.

Visible이 False가 되어 안보이면, 실제 Html에 표기되지 않으며

True가 되면 Html으로 나타나고, 화면상에도 보이게 된다.


CSS 

position, background-color, top, left 등의 값을 적용시켜주면 끝.