|
您好,我请求返回json格式的数据,url是这个http://restapi.amap.com/v3/assis ... ocations=116.329104,39.9558112&coordsys=gps&output=json&key=d57dae9686cfa57721708ac1517c98
a9,直接浏览器是能返回正确结果的,但是我用代码请求就报No 'Access-Control-Allow-Origin' header is present on the requested resource错误,这不科学啊。。。我的代码如下:
$("#a").click(function(){
$.getJSON(
"http://restapi.amap.com/v3/assistant/coordinate/convert",
{
locations:"116.329104,39.9558112",
coordsys:"gps",
output:"json",
key:"d57dae9686cfa57721708ac1517c98a9"
},
function(data)
{
alert(data.locations);
}
);
}); |
|