【发布时间】:2016-11-23 14:40:20
【问题描述】:
这是我调用的 api: https://api.github.com/search/repositories?q=language:python&sort=stars 当通过浏览器触发时,它会返回最高星的 python 项目并显示。 但是当我尝试从代码中访问 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);
});
【问题讨论】:
标签: javascript jquery json api jsonp