1
我在维基百科上进行此API调用,但它返回空对象。我想这与格式(jsonp?)有关。Wikipedia API调用返回空对象
这是呼叫:
apiCall = "https://en.wikipedia.org/w/api.php?action=query&format=json&callback=?prop=info|extracts&generator=search&callback=?&inprop=url&exsentences=3&gsrsearch=";
////////////Get info from API///////////
$.getJSON(apiCall + userSearch, function(data){
console.log(data);
也许你的'});'没有正确关闭? – halfer