分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow
也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!
如何使用:
首先要确认前端使用页面,比如登陆页面
1
2
|
<script src=
"http://code.jquery.com/jquery-1.12.3.min.js"
></script>
<script src=
"http://static.geetest.com/static/tools/gt.js"
></script>
|
1.在登陆页面访问引入类库:
如果您的网站使用https,则只需要将引入极验库的地方换成https协议即可,不需要更改其它地方。例如更换成以下代码即可:
1
2
|
<script src=
"https://code.jquery.com/jquery-1.12.3.min.js"
></script>
<script src=
"https://static.geetest.com/static/tools/gt.js"
></script>
|
2.初始化前端
下面的代码需要在页面加载后就执行,如果你使用jQuery,可以写在$(function(){});内
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
$.ajax({
// 获取id,challenge,success(是否启用failback)
url:
"../web/StartCaptchaServlet.php?t="
+ (
new
Date()).getTime(),
// 加随机数防止缓存
type:
"get"
,
dataType:
"json"
,
success:
function
(data) {
// 使用initGeetest接口
// 参数1:配置参数
// 参数2:回调,回调的第一个参数验证码对象
|