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, //是否缓存 可以为false
success: function (data) {
alert(JSON.stringify(data));
},
error: function (data) {
// alert(JSON.stringify(data));
}
});
}