百度地图地址解析异常
$.ajax({
type: "GET",
url: "http://api.map.baidu.com/geocoder?location=31.997909,118.768387&output=json&key=gfUh4SmP5gVW2qTdnYfgeyAK",
dataType:"jsonp",
success: function (result) {
alert(result);
},
error: function (result, status) {
alert("error");
}
});
直接在浏览器地址栏上敲http://api.map.baidu.com/geocoder?location=31.997909,118.768387&output=json&key=gfUh4SmP5gVW2qTdnYfgeyAK有返回结果;ajax跨域请求异常!