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"> <A href="#" class="standardLink" name="refreshImage" id="refreshImage" onClick="javascript:refreshImageCode();">Refresh</A&开发者_JAVA百科gt;
/* 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
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));
}
精彩评论