2016-08-29 13 views

答えて

0

シンプルなjavascript関数を使用して、youtube api v3からデータを取得できます。

function Get(yourUrl) 
{ 
var Httpreq = new XMLHttpRequest(); // a new request 
Httpreq.open("GET",yourUrl,false); 
Httpreq.send(null); 
return Httpreq.responseText;   
} 

通話機能と

var json_obj = JSON.parse(Get("yourUrl")); 
console.log("this is the author name: "+json_obj.ObjectvalueWhateveritis); 

JSON

にデータを使用するには、ここにあなたのURLが

https://www.googleapis.com/youtube/v3/search?key={$this->key}&part={$part}&maxResults={$this->limit}&type=video&relatedToVideoId={$id} 

はそれがあなたのお役に立てば幸いです。

関連する問題