Jmnote bot (토론 | 기여) 잔글 (로봇: 자동으로 텍스트 교체 (-http://zetawiki.com/jq/ +http://zetawiki.com/ex/jquery/)) |
잔글 (Jmnote님이 JQuery ready() 문서를 JQuery .ready() 문서로 이동했습니다) |
(차이 없음)
|
2017년 1월 8일 (일) 16:43 판
1 개요
- jQuery ready
- jQuery onload
2 기본형
html
Copy
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script>
$(document).ready(function() {
alert("로딩 완료");
});
</script>
3 축약형 ★
html
Copy
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script>
$(function() {
alert("로딩 완료");
});
</script>
4 여러 개 테스트
- 아래와 같이 여러 개를 써도 정상 작동하지만 굳이 이렇게 할 필요는 없다…. 비추
html
Copy
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script>
$(document).ready(function() { alert("첫번째 ready"); });
$(document).ready(function() { alert("두번째 ready"); });
$(document).ready(function() { alert("세번째 ready"); });
</script>
5 같이 보기
6 주석
7 참고 자료
편집자 Jmnote bot Jmnote
로그인하시면 댓글을 쓸 수 있습니다.