效果:随机生成一个验证码
代码:image.html(生成验证码)和check.php(验证验证码是否输入正确)
效果图详见代码下面的截图
image.html
<script src="https://cdn.kgcaptcha.com/captcha.js?appid=94dATYQa"></script>
<script>
kg.captcha({
// 绑定元素,验证框显示区域
bind: "#captchaBox",
// 验证成功事务处理
success: function(e) {
console.log(e);
},
// 验证失败事务处理
failure: function(e) {
console.log(e);
},
// 点击刷新按钮时触发
refresh: function(e) {
console.log