javascript不能跳转

<!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>Gallery</title>
<script type="text/javascript" src="scripts/reP.js" language="javascript"> </script>
</head>
<h1>Gallery</h1>
<ul>
<li><a href="image/bigben.jpg" onclick="replacePic(this);return false;">大本钟</a></li>
<li><a href="image/coffee.jpg">咖啡</a></li>
<li><a href="image/fireworks.jpg">烟火</a></li>
<li><a href="image/rose.jpg">玫瑰</a></li>
</ul>

<img id="ima" src="image/placeholder.gif">
<body>
</body>
</html>

目的是在点击大本钟的时候img替代位大本钟。在此中,出现2个问题导致失败

1,脚本var new=---‘new是关键字失败

2,old.setAttribute("src",newPic); old敲成olc失败

原文地址:https://www.cnblogs.com/bashala/p/3341899.html