0
可能的使用$.ajax
没有?callback=
?
我试图得到这个URL http://gbrds.gbif.org/registry/organisation/15b278a8-1356-4f7b-ba32-3c733c3d0aac.json?op=contacts的JSON响应,但在请求中,jQuery将?callback=
添加到了url中,因此得到了不同的结果。
请求是远程域:
$.ajax({ url: encodeURI("http://gbrds.gbif.org/registry/organisation/15b278a8-1356-4f7b-ba32-3c733c3d0aac.json?op=contacts"),
dataType: 'jsonp',
type: 'GET',
success: function(data){...});
$ .ajax不一定需要回调,但使用jsonp。这是使用jsonp的一点。 http://en.wikipedia.org/wiki/JSONP – jszpila