这段语句咋总报错?错在哪里了?_html/css_WEB-ITnose

WBOY
發布: 2016-06-24 12:07:05
原創
1090 人瀏覽過


<script> <br /> function mouseOver(id, pic) <br /> { <br /> document.getElementById(id).src = pic <br /> } <br /> function mouseOut(id, pic) <br /> { <br /> document.getElementById(id).src = pic <br /> } <br /> </script>




这段语句咋总报错?错在哪里了?_html/css_WEB-ITnose



这段语句咋总报错?错在哪里了?_html/css_WEB-ITnose


回复讨论(解决方案)

<html><head>    <script type="text/javascript">        function mouseOver(id, pic)        {            document.getElementById(id).src = pic        }        function mouseOut(id, pic)        {            document.getElementById(id).src = pic        }    </script></head><body>    <a target="_blank" href="mailto:support@xxxxxxxx.com">        <img border="0" id="img1" src="e1.png"    style="max-width:90%" width="32" alt="" onmouseover='mouseOver("img1", "e1.png")'onmouseout='mouseOut("img1", "e0.png")'></a>        <a target="_blank" href="https://twitter.com/xxxxxxxx">            <img border="0" id="img2" src="t0.png"    style="max-width:90%" width="32" alt="" onmouseover='mouseOver("img2", "t1.png") 'onmouseout='mouseOut("img2", "t0.png")'></a></body></html>
登入後複製

onmouseover='方法()‘; 方法需要引号引起来

上面不是用引号了吗?难道引号里不能加参数吗?

报的什么错误,应该贴出错误信息或失败的截图。

上面不是用引号了吗?难道引号里不能加参数吗?
哪里有引号!!!你好好看我的代码是怎么写的

上面不是用引号了吗?难道引号里不能加参数吗?
onmouseover= ’mouseOver("img1", "e1.png")  '
你看你代码这有引号吗


上面不是用引号了吗?难道引号里不能加参数吗?
哪里有引号!!!你好好看我的代码是怎么写的

擦,我看成括号了。

这个引号是单引号还是双引号?



上面不是用引号了吗?难道引号里不能加参数吗?
哪里有引号!!!你好好看我的代码是怎么写的

擦,我看成括号了。

这个引号是单引号还是双引号?

你括号里面双引号这里就用单引号 你括号里面有单引号外面就用双引号

明白了,谢谢!

感觉这个语法真是多此一举,何必要加引号呢。

分都给你。

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!