test.php
<script type="text/javascript">
alert("1");
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>무제 문서</title>
<script type="text/javascript">
alert("2");
</script>
</head>
<body>
<script type="text/javascript">
alert("3");
</script>
</body>
</html>
<script type="text/javascript">
alert("4");
</script>
위와 같은 페이지 소스가 있을 때,
1,2,3,4 순으로 실행이 되더라... 뭐 당연한 것인가
그런데! 맨처음 alert("1"); 이 문장은 2번 실행된다.
(사실 이 실험은 작업중에 alert메세지가 두번 나옴으로서 확인해보고 싶어서 시작한거였음)
처음 페이지를 로드 할 때 2번 실행되고, F5를 눌러 리프레쉬를 시키면 1번 실행된다.
역시 망할 ie8인가... ie7도... (파폭은 잘됨)
'ㅋ > HTML/JAVA SCRIPT/CSS' 카테고리의 다른 글
[HTML] W3C /IE의 box model (0) | 2010.10.19 |
---|---|
[javascript/ajax/jquery] ajax로 append 할 때 javascript의 function 사용 (0) | 2010.10.16 |
javascript opener (0) | 2010.10.04 |
getElementById (0) | 2010.09.15 |
textarea에 정보 출력하기 (0) | 2009.12.28 |