javaScript/jQuery

제이쿼리(jQuery) 기초

홍로그 2017. 2. 25. 15:51

개요

  • 문서 객체 모델과 관련된 처리를 쉽게 구현
  • 일관된 이벤트 연결을 쉽게 구현
  • 시각적 효과를 쉽게 구현
  • Ajax 애플리케이션을 쉽게 개발

지원 브라우저 

  • 파이어폭스
  • 구글 크롬
  • 사파리 
  • 오페라 
  • 익스플로러(제이쿼리 2.x 버전부터는 인터넷 익스플로러 9 이후 버전을 지원)

사용법

  • jQuery(document).ready()
  • $(document).ready() "jQuery"대신 "$"로 사용하는 방법


예시

1
2
3
4
5
6
7
8
9
10
11
12
13
<head>
<script src="js/jquery-1.10.2.js">
</script>
</head>
<script>
jQuery(document).ready(){
 alert("hello world");
}
 
$(document).ready(){
 alert("hello world");
}
</script>
cs