Vicky
Vicky

Reputation: 9585

Problem in IE 8

Hi Calling my image code refresh using following code

Here "captchaController.do" is the springController.

  <img name="captchaImage" id="captchaImage" src="captchaController.do" width="150px" height="30px">&nbsp;<A href="#" class="standardLink" name="refreshImage" id="refreshImage" onClick="javascript:refreshImageCode();">Refresh</A>

/* This is used to refresh the image code*/
function refreshImageCode(){
 $("#captchaImage").attr("src", "captchaController.do");
}

its working fine IE6 but problem in IE 8. Nothing is going happen. Image is not displayed

Please help

Upvotes: 1

Views: 145

Answers (1)

Doug Neiner
Doug Neiner

Reputation: 66191

IE8 is probably caching your image (or not trying to reload since the name is the same). Try this:

function refreshImageCode(){
    $("#captchaImage").attr("src", "captchaController.do?" + (Math.random() * 1000));
}

Upvotes: 1

Related Questions