jQuery的getJSON不支持REST端
16lz
2021-01-22
I have a REST end of my API at the following address : http://test.jll.aplikacje-dedykowane.pl/rest/warehouse/all . Now I'm trying to return the JSON data prepared at this page but I'm constantly getting null (with 200 OK) as a result.
我的API的其余部分位于以下地址:http://test.jll.aplikacje-dedykowane。pl / rest /仓库/。现在,我尝试返回这个页面准备的JSON数据,但结果总是为null (200 OK)。
var getSearchResults = function(){
var url = '',
data = '';
url = 'http://test.jll.aplikacje-dedykowane.pl/rest/warehouse/all';
$.getJSON(url, function(data){
console.log(data);
});
}
1 个解决方案
#1
1
You're probably running into the same site origin policy, assuming that url is outside of the domain that calling it.
假设url位于调用它的域之外,您可能会遇到相同的站点起源策略。