我正在尝试访问education.com API数据.但是,我一直收到错误指出的错误:
XMLHttpRequest无法加载 http://api.education.com/service/service.php?f=schoolSearch&key=mykey&sn=sf&v=4&city=Atlanta&state=ga&Resf=json.Access-Control-Allow-Origin不允许使用Origin.
我的代码如下:
$(function(){
$.getJSON('http://api.education.com/service/service.php?f=schoolSearch&key=mykey&sn=sf&v=4&city=Atlanta&state=ga&Resf=json',
function(data) {
console.log(data);
});
});
Run Code Online (Sandbox Code Playgroud)
有谁可以帮助我吗?