亟待了解‘缺少对象’的原因

想试验一下jascript事件属性的使用,我简写了下小代码可是运行时总提示两处缺少对象,不知道到底是什么原因造成的-!-希望大既能给于指点评判

<html>
<head>
<title>使用的事件属性</title>
</head>
<body>
<script>
imageA = new Image(50,50)
imageA.οnlοad=displayAlert
imageA.src="C:/Documents and Settings/Administrator/My Documents/My Pictures/19.gif" function displayAlert(theImage) {
   if (theImage == null) {
      alert('An image loaded')
   }
   else alert(theImage.name + ' has been loaded.')
}

</script> <img name="imageB" src="C:/Documents and Settings/Administrator/My Documents/My Pictures/19.gif" align="top"
   onLoad="displayAlert(this)"><br> 关于事件适用对象.

<script>
var cycles=0
</script>
<img src="C:/Documents and Settings/Administrator/My Documents/My Pictures/m2.gif" boder=0 align="top"
   onLoad="++cycles">
<input type="button" value="循环次数"
   onClick="alert('The animation has looped ' + cycles + ' times.')">Why???
<script>
var whichImage=0
var maxImages=5 function changeAnimation(theImage) {
   ++whichImage
   if (whichImage <= maxImages) {
      var imageName="!anim" + whichImage + ".gif"
      theImage.src=imageName
   } else {
      whichImage=-1
      return
   }
}

</script> <img name="changingAnimation" src="C:/Documents and Settings/Administrator/My Documents/My Pictures/28.gif" boder=0 align="top"
   onLoad="changeAnimation(this)">

</body>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值