s = encodeURIComponent(s);//특수기호 포함 encode

        s = encodeURI(s);

        document.write(s+'<br><br>');

        s=decodeURI(s);//한글만 decode

        s=decodeURIComponent(s); //특수기호 포함 decode


[mysql Download]

Community Download -> Download MySQL Community Server -> installer 클릭 -> 378.8M 다운로드 -> No, thanks


[이벤트 처리]

· 버튼 클릭 -> 이벤트 발생 -> 함수 실행 -> 페이지 변화(2,3,4 권장)

1) 버튼에 이벤트 속성 주기 -> onclick="fn()";

2) 버튼에 아이디(mybtn) 부여 -> mybtn.onclick=function();//랜더링완료이후(body onload / window.onload / window.addEventListner("load", 콜백함수)

3) window.onload=function () {

            mybtn.addEventListener("click", fn)//(string, callback함수)

    }

4) window.addEventListener("load", init);

        function init() {

            mybtn.addEventListener("click", fn)//(string, callback함수)

        }

5) window.addEventListener("load", function () {

            mybtn.addEventListener("click", function () {

                alert('call~~~~~~~');

            })

        })

· onfocus="foFn()"; : 해당 영역에 커서 위치할 때

· onblur="bluFn()"; : 해당 영역에서 커서가 빶져나갔을 때

· <script>

        function fn() {

            alert('call');

            location.href="a.html";

        }

    </script>

<form action="javascript:fn()"> : 자바스크립트 함수 호출 가능

· onkeypress="fn()" : 아스키코드(a-z 0-9 !@#%^^)

·  onkeyup="fn()" : 키 눌렀다가 땔때

·  onkeydown="fn()" : 키 누를 때

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <title>Title</title>

    <script>

        function fn(event) {

            console.log('call', event.which);//누르는 키 값 알려준다.

        }

    </script>

</head>

<body>

    <input id="txt1" type="text" onkeydown="fn(event)"><br>

</body>

</html> 



[키보드로 움직이기]

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <title>Title</title>

    <style>

        #mydiv{

            position: absolute;

            left: 100px;

            width:50px;

            height:50px;

            background-color: red;

        }

    </style>

    <script>

        n=100;

        function fn(event) {

            if(event.which==39){

                n+=10;

            }else if(event.which==37){

                n-=10;

            }

            mydiv.style.left=n+"px";          

        }

    </script>

</head>

<body>

    <div id="mydiv" tabindex="0" onkeydown="fn(event)"></div>

</body>

</html> 


· rst=eval("10+20");

  console.log(rst);//출력결과 30나옴

· 

· set SQL_SAFE_UPDATES=0;

-mysql 처음 실행 시, 삭제 안될때 작성

· 

· 

· 

· 

· 

· 

· 

· 

· 

· 

· 

· 

· 

· 

+ Recent posts