TypeError:未定义不是对象 [英] TypeError: undefined is not an object

查看:115
本文介绍了TypeError:未定义不是对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

onmouseover 命令遇到问题。我的HTML代码中有少量代码(请参阅底部),当我尝试在Safari 7上运行它时,出现以下错误:

I'm having problems with the onmouseover command. I've got this little bit of code (see bottom) in my HTML code and when I try to run it on Safari 7 I get the following error:


TypeError:未定义不是对象(评估
'document.images.siz3.src ='images / shirts / img_3siz_grey.jpg'')
onmouseover

TypeError: undefined is not an object (evaluating 'document.images.siz3.src='images/shirts/img_3siz_grey.jpg'') onmouseover

出了什么问题?我找不到任何可能出错的信息。 img 应该定义为 siz1 ,不是吗?

What's the problem? I can't find anything that could be wrong. The img should be defined as siz1, shouldn't it?

也许有人可以提供帮助,我敢肯定答案很简单,但我只是没有看到它。

Maybe someone could help, I'm sure the answer's easy and I'm just not seeing it.

<a href="menu/latein/r-z/vfc/vfc.html" onmouseover="document.images.siz1.src='images/shirts/img_1siz_grey.jpg'" onmouseout="document.images.siz1.src='images/shirts/img_1_siz.jpg'" name="tshirts">
<img src="images/shirts/img_1_siz.jpg" name="siz1"  alt="Vivat floreat crescat" width="195px" height="135px"></img>

推荐答案

在这里类似问题 name = siz1 应该是 name = siz1 替换为

Looks like problem in here name="siz1" should be name="siz1" replace " to "

这篇关于TypeError:未定义不是对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆