0
但是,我想通過函數爲圖像調用我的鼠標上的java腳本函數;調試器說「功能未定義」。我不明白爲什麼我得到這個錯誤。 Java腳本和標籤看起來是正確的,它看起來像我使用正確的語法來調用該函數。在HTML中無法識別的Javascript函數
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Chapter11-1</title>
<script type="text/javascipt">
function overButton(img) {
\t buttonImg="chapter11-1"+img+"_over.gif"
\t document.getElementById(img).src=buttonImg
\t }
\t function downButton(img) {
\t buttonImg="chapter11-1"+img+"_down.gif"
\t document.getElementById(img).src=buttonImg
\t }
\t function upButton(img) {
\t buttonImg="chapter11-1"+img+"_up.gif"
\t document.getElementById(img).src=buttonImg
\t }
</script>
</head>
<body>
<div id="banner_logo"><img src="chapter11-1banner.jpg" width="745" height="150" alt="banner" id="banner" /></div>
<table class="centerItems">
\t <tr>
\t <td>
\t <a href="#">
\t <img src="chapter11-1home_up.gif" id="home" alt="home" onMouseOver="overButton('home')" onMouseDown="downButton('home')" onMouseOut="upButton('home')" onMouseUp="upButton('home')" /></a>
\t </td>
</body>
</html>
這是一個typo.It要註釋。 – jan86
您的HTML無效,這是主要問題,您已經打開TR而不關閉它,未關閉的桌子等。 – adeneo
有一刻我會添加整個標記。 – jan86