[Javascriprt] 자주사용하는 옵션들.

2009. 6. 25. 13:47 - 에릭투스

0. javascript에서 method
 : <script type="text/javascript">
 function function_name(){}
   </script>

1. window.document.getElementById("id")

1-1. window.document.getElementById("id").value
     : 안에 value가져오기.

2. 객체 Date : 날짜..

3. window.setInterval("대상",milsec);
  : 실시간 으로 로딩됨.ㅋ

4. <body onload="function();"
  : 처음 시작시 loading

5. 내부 html에서 loading
   : onclick="function();"

6. var re = new RegExp(/^[0-9a-z]{4,12}$/);
  : 정규식
  : (/^(시작부터) $/(끝까지));
  [0-9a-z]{4,12}
  :"0~9","a-z" : 사용가능.
  :"4,12 : 조건식 : 4자이상,12자이하.

7. Math.random();

8. Math.round(Math.random()*10);

9. var array = new Array(3);


10.
screen.width);
screen.height);
screen.availHeight);
screen.availWidth);

11.  
location.host;
location.port;
location.protocol;
location.hostname;
 
12. <form action="http://localhost:8080/PP/Hello" method="post">
 </form>


 

다른 카테고리의 글 목록

웹 개발/자바스크립트 기초 카테고리의 포스트를 톺아봅니다