aduygau 2017-02-07 01:54 采纳率: 50%
浏览 3490
已采纳

jsp中使用标签img中onclick没有反应

  function change() {
        var img=document.getElementById("verifyCode");
        img.src="${pageContext.request.contextPath}/varifyCode.action?"+new Date().getTime();
        alert(img.src);
    }

img id="varifyCode" class=" captchaImage" src="${pageContext.request.contextPath}/verifyCode.action" onclick="change()" 
  • 写回答

3条回答 默认 最新

  • 斯洛文尼亚旅游 2017-02-07 03:37
    关注

    action名字都错了。。自己好好对比看看。。。verifyCode...varifyCode

           src="${pageContext.request.contextPath}/verifyCode.action"
    img.src="${pageContext.request.contextPath}/varifyCode.action?"+new Date().getTime();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?