onclick="showPic(this);return false;"无法跳转怎么办

<!DOCTYPE html>



Image Galley

<br> function showPic(whichpic) {<br> var source = whichipic.getAttribute(&quot;href&quot;);<br> var placeholder = document.getElementById(&quot;placeholder&quot;);<br> placeholder.setAttribute(&quot;src&quot;,source);<br> }<br>

Snapshots


你加了个return false 当然无法跳转啊

建议好好研究研究return false;在函数中所扮演的角色吧。你这个将false除掉应该就可以了

不要用return嘛,return如果用在函数中就直接跳出函数咯。除非是你觉得情况不满足了要跳出这个函数再用return