<%--
Created by IntelliJ IDEA.
User: asus
Date: 2019/1/24
Time: 15:57
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
<title>Title</title>
<script type="text/javascript" src="/static/jquery-1.8.3.min.js"></script>
</head>
<body>
<script type="text/javascript">
//客户端实现一
$(function () {
$.ajax({
type: "get", //都是get传值
async: true, //同异步
url: "https://tcc.taobao.com/cc/json/mobile_tel_segment.htm",
data: {"tel": "15210958791"},
dataType: "jsonp",
jsonp: "callback",//传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(一般默认为:callback)
jsonpCallback: "handler",//自定义的jsonp回调函数名称,默认为jQuery自动生成的随机函数名,也可以写"?",jQuery会自动为你处理数据
success: function (json) {
console.log(json);
alert(json);
},
error: function () {
alert('fail');
}
});
});
</script>
</body>
</html>