此代码浏览器兼容性高 <script type="text/javascript"> <!-- // there's two ways get validate image, // these two are all using random methods // one is random, the other is get current time // added by Woolenhy function refreshimg() { document.getElementById('ImgCodeLabelID').src='YourImageCodePage.asp?code=' + Math.random(); // document.getElementById('ImgCodeLabelID').src='YourImageCodePage.asp?time='+ (new Date().getTime().toString(36)); return false; } // --> </script> <img id="ImgCodeLabelID" src="YourImageCodePage.asp" οnclick="javascript:refreshimg()" style="cursor: hand" alt="看不清?点击刷新">