急,能帮我看一下以下代码有什么错误吗?谢谢 <a href="http://www.baidu.com" onmouseover=="turnOn();" onmouseout="turnOff();"> 这样写有问题吗 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 onmouseover=="turnOn();" 第一眼多了一个“=” 关键字在大小写var不能写成Varfunction不能写成FunctionJavascript是区分大小写的onmouseover=="turnOn();这里,用一个等于号就可以了我稍微改了一下<!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" src="jquery-1.2.6.min.js"></script></head><body onload="InitloadImg()"><script type="text/javascript">var img1 = "http://www.google.cn/intl/zh-CN/images/logo_cn.gif";var img2 = "http://www.baidu.com/img/baidu_logo.gif";var img = null;function InitloadImg(){ img = document.getElementById("pic"); img.src = img1;} function turnOn(){ img.src = img2;} function turnOff(){ img.src = img1;} </script><P>将鼠标放在下图上面,图片将被另一幅图片所代替,鼠标移走,图片又复原 <P> <a href="http://www.baidu.com" onmouseover="turnOn();" onmouseout="turnOff();"> <img name="introduction" src="http://www.google.cn/intl/zh-CN/images/logo_cn.gif" id="pic"></a> </body></html> <a href="http://www.baidu.com" onmouseover=="turnOn();" onmouseout="turnOff();"> 多了一个 = 号---------><a href="http://www.baidu.com" onmouseover="turnOn();" onmouseout="turnOff();"> 搞那么复杂干什么?<a href="http://www.baidu.com"><img name="introduction" src="原图.gif" onmouseover="this.src='新图.gif'" onmouseout="this.src='原图.gif'"> </a> jQuery中的toggle()问题 js类型转换在chrome和火狐上遇到麻烦了 小div(用来显示重要信息)怎么随着带滚动条的大div滚动而移动(FF) QQ群相册的源代码太神奇了 为什么我写的弹出消息层在Firefox没用。 导出word问题 提交数据前不用点击提交按钮,表单位中input自动检测有没有输入数据,如何实现 js数组的问题 javascript如何替换字符串中的某个字符? 高手救命,小弟有个鼠标跟随图片问题,请大虾帮忙,在线等,急急急急急!!! 问卷调查系统 用JS实现问卷编辑的问题 javascript模拟特效 求助急~~~
var不能写成Var
function不能写成Function
Javascript是区分大小写的onmouseover=="turnOn();这里,用一个等于号就可以了我稍微改了一下<!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" src="jquery-1.2.6.min.js"></script>
</head>
<body onload="InitloadImg()">
<script type="text/javascript">
var img1 = "http://www.google.cn/intl/zh-CN/images/logo_cn.gif";
var img2 = "http://www.baidu.com/img/baidu_logo.gif";
var img = null;
function InitloadImg()
{
img = document.getElementById("pic");
img.src = img1;
}
function turnOn()
{
img.src = img2;
}
function turnOff()
{
img.src = img1;
}
</script>
<P>将鼠标放在下图上面,图片将被另一幅图片所代替,鼠标移走,图片又复原 <P>
<a href="http://www.baidu.com" onmouseover="turnOn();" onmouseout="turnOff();">
<img name="introduction" src="http://www.google.cn/intl/zh-CN/images/logo_cn.gif" id="pic">
</a>
</body>
</html>
--------->
<a href="http://www.baidu.com" onmouseover="turnOn();" onmouseout="turnOff();">
<a href="http://www.baidu.com">
<img name="introduction" src="原图.gif" onmouseover="this.src='新图.gif'" onmouseout="this.src='原图.gif'"> </a>