日期:2014-05-16  浏览次数:20347 次

主题:JavaScript执行顺序的小测试
<html>
  <head>
    <title>test.html</title>
    <script type="text/javascript" src="jquery-1.4.2.js"></script>
    <script type="text/javascript" >
	window.onload=function(){
		alert("5");
	}
	$(function(){
		alert("3");
	});
	alert("1");
	</script>
  </head>
  <body>
  <script type="text/javascript" >
	window.onload=function(){
		alert("6");
	}
	$(function(){
		alert("4");
	});
	alert("2");
  </script>
  </body>
</html>

?