<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>手机号查询</title>
</head>
<body>
<center>
<tr>
<td><h3><font style="color:red">请输入查询手机号</font></h3><input type="text" id="tel"><input type="button" value="查询" id="button"></td>
</tr>
<table border="1" id="table" style="display:none;">
<tr>
<td>归属地</td>
<td>手机号</td>
<td>卡</td>
</tr>
<tbody id="tbody"></tbody>
</table>
</center>
</body>
</html>
<script src="jquery-2.1.4.min.js"></script>
<script>
$("#button").click(function(){
var tel =$("#tel").val();
$.ajax({
type: "GET",
// async: false,
url:"http://api.k780.com:88/?app=phone.get&phone="+tel+"&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json&&jsoncallback=data",
dataType: "jsonp",
jsonp: "callback",//传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(一般默认为:callback)
jsonpCallback:"data",
success:function(data){ //成功执行处理,对应后台返回的getName(data)方法。
// alert(data.result)
var str="";
str+="<tr>";
str+="<td>"+data.result.att+"</td>";
str+="<td>"+data.result.phone+"</td>";
str+="<td>"+data.result.operators+"</td>";
str+="</tr>";
$("#table").show();
$("#tbody").html(str);
}
})
})
</script>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>手机号查询</title>
</head>
<body>
<center>
<tr>
<td><h3><font style="color:red">请输入查询手机号</font></h3><input type="text" id="tel"><input type="button" value="查询" id="button"></td>
</tr>
<table border="1" id="table" style="display:none;">
<tr>
<td>归属地</td>
<td>手机号</td>
<td>卡</td>
</tr>
<tbody id="tbody"></tbody>
</table>
</center>
</body>
</html>
<script src="jquery-2.1.4.min.js"></script>
<script>
$("#button").click(function(){
var tel =$("#tel").val();
$.ajax({
type: "GET",
// async: false,
url:"http://api.k780.com:88/?app=phone.get&phone="+tel+"&appkey=10003&sign=b59bc3ef6191eb9f747dd4e83c99f2a4&format=json&&jsoncallback=data",
dataType: "jsonp",
jsonp: "callback",//传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(一般默认为:callback)
jsonpCallback:"data",
success:function(data){ //成功执行处理,对应后台返回的getName(data)方法。
// alert(data.result)
var str="";
str+="<tr>";
str+="<td>"+data.result.att+"</td>";
str+="<td>"+data.result.phone+"</td>";
str+="<td>"+data.result.operators+"</td>";
str+="</tr>";
$("#table").show();
$("#tbody").html(str);
}
})
})
</script>