문서의 이전 판입니다!
http://jquery.com/ 에 가면 메인 화면에서 바로 다운로드가 가능
태그안에 스크립트를 써넣음
<!DOCTYPE html> <html> <head> <title>ex1</title> <script type="text/ecmascript" src=jquery-1.6.2.min.js></script> <script type="text/ecmascript"> </script> </head> <body> </body> </html>
jqeury함수사용 예
<!DOCTYPE html> <html> <head> <title>ex1</title> <script type="text/ecmascript" src=jquery-1.6.2.min.js></script> <script type="text/ecmascript"> jquery(document).ready(function(){ //$(document).ready()와 동일 alert("Hello Jquery!"); }); </script> </head> <body> </body> </html>
$(document).ready()함수
이는 jQuery가 제공하는 이벤트 메서드 중 하나.
문서의 DOM 요소들을 조작 가능한 시점이 되면 자동으로 호출이 되는 이벤트 메서드
굳이 비교하자면, window.onload 이벤트와 유사하며 메서드의 인자로는 델리게이트 함수명을 기입하거나, 익명 함수를 작성