当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Google Knowledge Graph Search API @type field JQuery

问题描述:

I need help with the Google Knowledge Graph Search API and JQuery. In order to get datas from the API, I'm using AJAX and so I wrote this code:

 $.ajax({

url: link1, //Where link1 is the actual URL with the API Key

dataType: 'json',

type: 'get',

cache: false,

success: function(data) {

$(data.itemListElement).each(function(index,value) {

console.log(value.result);

});

}

});

Now, if you take a look at the response I get from the API in the Google APIs Explorer, you'll see that in the JSON, under itemListElement and result, there's an array called @type containing Thing and Person in this case. That's basically what I want to get from the API and then output into a DIV.

How's that possible?

Thank you in advance!

分享给朋友:
您可能感兴趣的文章:
随机阅读: