I\'m trying to change an image in JavaScript+Prototype by changing the \"src\" attribute of the element. It works fine in IE, but not in Firefox. I don\'t get any errors and the
Cant figure out what is wrong, but I believe its possible to do a:
image.src = "../images/icons/icon_minus.gif";
BTW, is the image path absolutely correct?
This function works fine in all browsers(chrome,Firefox,IE,Edge,...):
function recaptcha() {
$("#captcha-img").attr('src', "");
setTimeout(function(){
$("#captcha-img").attr('src', "captcha?"+new Date().getTime());
}, 0);
}
The important point is generating new URL which forces FF and IE to re-render the image.