码迷,mamicode.com
首页 > Web开发 > 详细

根据IP获取经纬度 js

时间:2019-09-05 13:24:47      阅读:234      评论:0      收藏:0      [点我收藏+]

标签:erro   jquery   getx   var   rip   api   map   function   ESS   

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" ></script>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<script>
function getXYbyIP() { 
var url="https://api.map.baidu.com/location/ip?ak=HQi0eHpVOLlRuIFlsTZNGlYvqLO56un3&coor=bd09ll";
$.ajax({
    url:url,
    type: ‘POST‘, 
    dataType: ‘JSONP‘,
    async: false, 
    cache: true, 
    success: function (data) { 
        console.log(data)
       
    }, 
    error: function (data) { 
    } 
 }); 
}
getXYbyIP();
</script>
</head>
<body>
</body>
</html>

  

根据IP获取经纬度 js

标签:erro   jquery   getx   var   rip   api   map   function   ESS   

原文地址:https://www.cnblogs.com/laneyfu/p/11465184.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!