I try to reload a new captcha image using a simple ajax GET. Works fine in FF and Chrome but, but in all IEs it fails after the first reload.
After deleting the browser cache the request succeed and I get a new Captcha.
I’m using this code:
function generateCaptcha() {
var timestamp = (new Date()).getTime();
requestMappingCaptcha = "/javaWeppAppPath/generateCaptcha";
jQuery.get(requestMappingCaptcha, timestamp, function(data) {
$("#captchaImg").slideUp("fast");
if (!$.browser.msie || ($.browser.msie && $.browser.version == "9.0")) {
// animate reloadArrows
$("#reloadArrows").rotate({
angle:0,
animateTo:360
});
}
// setting new source
var newSrc = $("#captchaImg").attr("src").split("?");
newSrc = newSrc[0] + "?" + timestamp;
$("#captchaImg").attr("src", newSrc);
$("#captchaImg").slideDown("fast");
});
}
I append a timestamp to the new image to avoid caching and I add a timestamp to the GET-Request to make it unique. But after the first reload the request can’t reach the mapped path.
I know there are some issues about IE and Ajax GET, but cant find an answer to my problem.. May you had a same problem and can show your solution?! thx
//rest of the ajax code herejquery ajaxSetup