我想制作一个在 Google 中搜索并显示第一个相关图像的脚本。
我的意思是,如果您在输入字段中键入:汽车
if you search to word "car" via Google它向我推荐了第一张图片。
你觉得怎么样,有什么方法可以做到这一点吗?
最佳答案
是的,使用 Google AJAX Search API 完全可以做到这一点.
你的代码看起来像这样:
var imageSearch = new google.search.ImageSearch();
imageSearch.setSearchCompleteCallback(this, function(results) {
// figure out which picture from results you want
});
imageSearch.execute('car');
关于jquery - 来自 Google 的 jQuery 图像建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2642994/