Dynamically change image src using Jquery not working in IE and firefox

前端 未结 4 748
长情又很酷
长情又很酷 2021-01-12 09:06

I am implementing a captcha for a email. when click on linkEmail button email modal will open. there i have to set captcha image generated by a handler (Captcha

4条回答
  •  清酒与你
    2021-01-12 09:53

    IE caching all GET request, so add a timestamp to your request URL e.g :

    $(".linkEmail").click(function () {
       //Load captcha image
       $('.imgCaptcha').attr('src', '/Custom/AppCode/Utilities/CaptchaGenerator.ashx?'+new Date().getTime());
       $('#emailModal').modal();
    });
    

提交回复
热议问题