如何在点击时验证码时刷新验证码

 一般通过js实现,重新载入src的值即可

<img src="index.php?p=back&c=Admin&a=captcha" onclick="this.src=this.src+'&k='+Math.random();"/>

+'&k='+Math.random()  这句话是给src的值加上一个随机数,有没有都可以,为了兼容浏览器,最好加上。

原文地址:https://www.cnblogs.com/xiaogou/p/9217273.html