[브라우저 객체모델] window.onload
- 📕 Programing/HTML-CSS
- 2014. 1. 13.
window.onload 실행순서
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
window.onload = function(){
alert('onload function()' );
};
</script>
</head>
<body>
<h1>Process-1</h1>
<script type="text/javascript">alert('process-1')</script>
<h1>Process-2</h1>
<script type="text/javascript">alert('process-2')</script>
</body>
</html>
실행결과를 확인해보면 HTML부분을 다 읽고나서 onload함수가 실행되는 것을 알 수 있다.
순서 : Process -1 ---> Process -2 ---> onload function()
'📕 Programing > HTML-CSS' 카테고리의 다른 글
IE 문서모드 설정 (0) | 2020.07.29 |
---|---|
[문서객체모델] 노드 생성 및 연결 (createElement / createTextNode) (0) | 2014.01.13 |
[주의] 자바스크립트의 실행순서 (0) | 2014.01.06 |
[내장 함수] 타이머 함수 (0) | 2014.01.06 |
for in 반복문 (0) | 2014.01.03 |