Captcha in IE does not refresh while the browser such as Google normal solution

  • 2020-03-30 02:22:00
  • OfStack

Today, when I was doing the captcha, I found that in IE, the captcha would not be refreshed, while other browsers such as Google have no problem. So I thought it should be the cache problem, because the default setting of IE is that if the access address does not change, it will not fetch but load the contents in the cache

So the solution is to add a random parameter after the switch address of the captcha

Such as:
 
<script> 
//Change the verification code
function changeimg(){ 
 
var time=Math.round(Math.random()*999)+3000; 
$('#captcha').attr('src','__APP__/Public/verify/time/'+time); 
} 
</script> 

Related articles: