谷歌搜索API-“;没有结果”;文本

Google Search API - "No results" text

本文关键字:结果 文本 API- 谷歌 搜索      更新时间:2023-09-26

有人知道如何将"无结果"更改为其他文本吗。。。

我有这个代码:

function OnLoad() {
  // Create a custom search control that uses a CSE restricted to code.google.com
  var customSearchControl = new google.search.CustomSearchControl('http://******');
  // Draw the control in content div
  customSearchControl.draw('ArticleGoogleSearchBox');
}

有什么想法吗???

有类似.setNoResultsString(str)的选项

https://developers.google.com/custom-search/docs/js/cselement-reference#cse-el

您可以在此URL中找到清晰的解决方案https://developers.google.com/custom-search/docs/js/rendering.阅读"示例:使用条件、迭代和局部变量的数据属性"一节,并应用if-else属性来自定义搜索内容。