1
これは私が呼び出しているAPIです: https://api.github.com/search/repositories?q=language:python&sort=stars ブラウザで起動されたときにスター付きのpythonプロジェクトを返し、表示します。 しかし、コードからjsonキーにアクセスしようとすると、定義されていません。 私は何が間違っていますか?jsonp API呼び出しから返されたjsonオブジェクトを読み込みます。
$.getJSON("https://api.github.com/search/repositories?q=language:python&sort=stars&callback=?", function(result){
alert(typeof(result));
alert(result.total_count);
alert(result.incomplete_results);
});
私はJSONP実装を知りたいと思った...解決策は、結果であることが判明。 data.key_name –
APIのdocumentantionはあなたの問題を解決することができます例があります。https://developer.github.com/v3/#json-p-callbacks –