2010-01-30 61 views
1

您好使用下面的代码调用我的图像代码刷新问题在IE 8中

这里“captchaController.do”是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"); 
} 

其工作很好的IE6,但在IE8中的问题。什么都不会发生。不显示图像

请帮

+0

你能更具体地说明问题是什么吗?你期望看到你没有得到什么结果? –

+0

编辑的问题 – Vicky

回答

1

IE8可能是缓存图像(或者不是要重装,因为名字是一样的)。试试这个:

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

对不起,有错误的函数名称。编辑的代码现在应该可以工作。 –

+1

嘿道格Neiner,其工作谢谢 – Vicky