SPATIUM Desktop
주소복사
About Operating System Languages Tools Favorites Notice Visit TEST  
     ADK (3)
     android (3)
     ASP (5)
     ASP.Net (1)
     C# (5)
     HTML (9)
     JAVA (7)
     JavaScript (9)
     jQuery (5)
     Mobile Web (2)
     node.js (1)
     Oracle (8)
     PHP (7)
     Spring Framework (4)
     SQL (17)
     WPF (5)
   ID  
   Password  
  |  
  Location United States
  IP Address 18.97.14.87
2024. 12
1234567
8910111213
14
15161718192021
22232425262728
293031
Category  Languages, JavaScript
Writer 김태우 Date 2014-04-11 10:12:38 Visit 5389
jQuery(ready, load) VS Javascript(onload)

 

jQuery(ready, load) VS Javascript(onload)

 

The order of execution

 

1. DOM element Loading

2. DOM element Load end, jQuery ready ( 이미지가 로딩되지 않아도 됨)

    2-1. Body onload

3. Document Load end, jQuery load ( 이미지등 모든 내용이 완료된 시점 )

 

sample code


<!doctype html>
<html lang="ko">
	<head>
		<meta charset="utf-8">
		<script src="./Scripts/jquery-1.9.1.js"></script>
	</head>
	<body onload="javascipt:alert('body tag onload(2-1)')">
		jQuery(ready, load) VS Javascript(onload) 
		<script>
		$(window).load(function(){
			alert('jquery load event(3)');
		});
		$(window).ready(function(){
			alert('jquery ready event(2)');
		});
		alert('script alert event(1)');
		</script>
	</body>
</html>
Tags  jQuery(ready, load) VS Javascript(onload)
  Relation Articles
[Languages-JavaScript] jQuery(ready, load) VS Javascript(onload) (2014-04-11 10:12:38)
  Your Opinion
Member ID
150 letters
Copyright (C) SPATIUM. All rights reserved.
[SPATIUM]WebMaster Mail