怎么我代码一样的,浏览器只显示图片,没有显示其他的结果?
<<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>domReady</title>
</head>
<body>
<div id="showMsg"></div>
<div>
<img src="images/Hydrangeas.jpg">
<img src="images/Jellyfish.jpg">
<img src="images/Koala.jpg">
<img src="images/Lighthouse.jpg">
</div>
<script type="text/javascript">
var d =document;
var msgBox = d.getElementById("showMsg");
var imgs = d.getElementsByTagName("img");
var time1 =null,time2 = null;
myReady(function(){
msgBox.innerHTML += "dom已加载!<br>";
time1 = new Date().getTime();
msgBox.innerHTML +="时间戳:"+time1+"<br>";
});
window.onload=function(){
msgBox.innerHTML+="onload已加载!<br>";
time2 = new Date().getTime();
msgBox.innerHTML +="时间戳:"+time2+"<br>";
msgBox.innerHTML+="domReady比onload快:"+ (time2-time1)+"ms<br>";
}
</script>
</body>
</html>