我需要在html頁面中顯示/隱藏圖像。我認爲它非常簡單。但爲什麼我得到的錯誤'可見'未定義。點擊顯示/隱藏圖像
<!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><title>Ajax Test
</title>
<script type="text/javascript">
<!--
function showImage(){
document.getElementById('loadingImage').style.visibility=visible;
}
-->
</script>
</head>
<body>
<input type="button" value="Ajax Button" onclick="showImage();"/>
<img id="loadingImage" src="ajax-loader.gif" style="visibility:hidden"/>
</body>
嘗試在引號中輸入'... style.visibility =「visible」' – laura 2010-01-04 11:54:57
請勿將您的腳本註釋掉:http://dorward.me.uk/www/comments-cdata/ – Quentin 2010-01-04 11:55:57