棘手的问题(请高手帮忙) function play(sc){document.getElementById("max").src=sc;alert("sadf");} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 写java写习惯了吧string sc function play(sc) { this.form1.max.src=sc; alert("sadf"); } JS不强制指定参数类型,只需要参数的名字就好了 <script language=javascript> <!-- function play(string sc) { this.form1.max.src=sc; alert("sadf"); } //--> </script>哈哈 string sc,看来都一样哈! function play(sc){document.getElementById("max").src=sc;alert("sadf");} 你的使用方法存在多种 错误如果直接引用名字 应该使用name属性,而不是id还有this并不代表document 引用1Lfunction play(sc){document.getElementById("max").src=sc;alert("sadf");} <img id="img1" src="qt.jpg" width="100" height="100" onmousemove="play('qt.jpg');"> <img id="img2" src="she.jpg" width="100" height="100" onmousemove="play('she.jpg');"> <img id="img3" src="ma.jpg" width="100" height="100" onmousemove="play('ma.jpg');"> <img id="img4" src="jz.jpg" width="100" height="100" onmousemove="play('jz.jpg');"> <img id="img5" src="cm.jpg" width="100" height="100" onmousemove="play('cm.jpg');"> <html> <head> <script language=javascript> <!-- function play(sc) { form1.max.src=sc; alert("sadf"); } //--> </script> </head> <body> <form id="form1"> <table cellspacing="1" width='100%' cellpadding="0"> <tr> <td> <img id="img1" src="qt.jpg" width="100" height="100" onmousemove="play('qt.jpg');"> <img id="img2" src="she.jpg" width="100" height="100" onmousemove="play('she.jpg');"> <img id="img3" src="ma.jpg" width="100" height="100" onmousemove="play('ma.jpg');"> <img id="img4" src="jz.jpg" width="100" height="100" onmousemove="play('jz.jpg');"> <img id="img5" src="cm.jpg" width="100" height="100" onmousemove="play('cm.jpg');"> </td> </tr> <tr> <td> <img id="max" src="qt.jpg" width="300" height="300"> </td> </tr> </table> </form> </body> </html> 代码语法问题,具体自已看下,我就不多说了. 求高手指教,万分感谢 下拉菜单怎么实现div+css 通过div中的onscroll事件,如何判断已经被滚动到了最底部 高手看过来:extjs 中如何关闭TabPanel中的选项卡页 截取小数的问题 如何自动执行javascript,而不弹出IE安全提示? 请问怎样实现这个特效? 子页面关闭时如何让父页面执行一次pageload,而不是reload()一次 怎么把多选框的数值加起来? 如何取消原来的键盘事件? 关于onclick事件的问题 关于js中的attachEvent的问题。
{
this.form1.max.src=sc;
alert("sadf");
} JS不强制指定参数类型,只需要参数的名字就好了
<script language=javascript>
<!--
function play(string sc)
{
this.form1.max.src=sc;
alert("sadf");
}
//-->
</script>
哈哈 string sc,看来都一样哈!
{
document.getElementById("max").src=sc;
alert("sadf");
} 你的使用方法存在多种 错误
如果直接引用名字 应该使用name属性,而不是id
还有this并不代表document
{
document.getElementById("max").src=sc;
alert("sadf");
}
<img id="img1" src="qt.jpg" width="100" height="100" onmousemove="play('qt.jpg');">
<img id="img2" src="she.jpg" width="100" height="100" onmousemove="play('she.jpg');">
<img id="img3" src="ma.jpg" width="100" height="100" onmousemove="play('ma.jpg');">
<img id="img4" src="jz.jpg" width="100" height="100" onmousemove="play('jz.jpg');">
<img id="img5" src="cm.jpg" width="100" height="100" onmousemove="play('cm.jpg');">
<html>
<head>
<script language=javascript>
<!--
function play(sc)
{
form1.max.src=sc;
alert("sadf");
}
//-->
</script>
</head>
<body>
<form id="form1">
<table cellspacing="1" width='100%' cellpadding="0">
<tr>
<td>
<img id="img1" src="qt.jpg" width="100" height="100" onmousemove="play('qt.jpg');">
<img id="img2" src="she.jpg" width="100" height="100" onmousemove="play('she.jpg');">
<img id="img3" src="ma.jpg" width="100" height="100" onmousemove="play('ma.jpg');">
<img id="img4" src="jz.jpg" width="100" height="100" onmousemove="play('jz.jpg');">
<img id="img5" src="cm.jpg" width="100" height="100" onmousemove="play('cm.jpg');">
</td>
</tr>
<tr>
<td>
<img id="max" src="qt.jpg" width="300" height="300">
</td>
</tr>
</table>
</form>
</body>
</html>
代码语法问题,具体自已看下,我就不多说了.