Jquery $.getJSON在另一台服务器中不工作
我遇到了一个奇怪的问题。getJSON工作不正常Jquery $.getJSON在另一台服务器中不工作,jquery,json,Jquery,Json,我遇到了一个奇怪的问题。getJSON工作不正常 $.getJSON('http://golfersapp.omaserver.com/courses.php?populate=country', function(listcountry1) { alert("golf server");//alert is not showing }); 但下面运行正常 $.getJSON('http://inveniya.net/jasmine-device/Tenant
$.getJSON('http://golfersapp.omaserver.com/courses.php?populate=country', function(listcountry1) {
alert("golf server");//alert is not showing
});
但下面运行正常
$.getJSON('http://inveniya.net/jasmine-device/TenantList.php', function(data) {
alert("inveniya");// it is showing properly
});
简单的提醒是不会来的!
两者都从同一页运行。一个在运行,另一个不运行。有线索吗
提前感谢页面上有一个小问题导致数据无效,请参阅页面的最后三行:
Notice: Undefined index: action in C:\inetpub\wwwroot\mobile\golfersapp\courses.php on line 100
Notice: Undefined index: action in C:\inetpub\wwwroot\mobile\golfersapp\courses.php on line 111
Notice: Undefined index: action in C:\inetpub\wwwroot\mobile\golfersapp\courses.php on line 137
您应该修复这些通知以获得有效的JSON。您试图发送跨域AJAX请求,这违反了限制
这只有在远程服务器(域)支持
JSONP
时才能工作,但情况似乎并非如此。在http://golfersapp.omaserver.com/courses.php?populate=country
只返回JSON
,而不是JSONP
您尝试过检查console.log(数据)
?您遇到了什么错误?