0

「結果なし」を他のテキストに変更する方法を知っている人はいますか...

私はこのコードを持っています:

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');

}

何か案は???

4

2 に答える 2

2

.setNoResultsString(str) のようなオプションがあります

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

于 2012-08-28T09:31:24.970 に答える
1

この URL https://developers.google.com/custom-search/docs/js/renderingから明確な解決策を見つけることができます。「例: 条件、繰り返し、およびローカル変数にデータ属性を使用する」セクションを読み、if-else 属性を適用して検索内容をカスタマイズします。

于 2012-08-28T09:32:10.757 に答える