【问题标题】:Google Custom WebSearch: hidden controlsGoogle 自定义 WebSearch:隐藏控件
【发布时间】:2011-12-31 12:49:28
【问题描述】:

我的网站上有这段代码:

<div id="cse" style="width: 100%;">Loading</div>
            <script src="//www.google.com/jsapi" type="text/javascript"></script>
            <script type="text/javascript"> 
              google.load('search', '1', {language : 'it'});
              google.setOnLoadCallback(function() {
                var customSearchControl = new google.search.CustomSearchControl('mybigbigbignumber');
                customSearchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
                customSearchControl.draw('cse');
              }, true);
            </script>
            <link rel="stylesheet" href="//www.google.com/cse/style/look/default.css" type="text/css" />

按预期工作:Google 搜索栏出现,搜索结果出现在下方的框中。

我需要的是一个“透明”的搜索操作。

我的意思是将整个表单中的搜索词传递给 google WebSearch 服务,并在我制作的自定义 css 化列表中显示结果。

【问题讨论】:

    标签: google-search google-search-api


    【解决方案1】:

    我最终使用了一些 jQuery 来隐藏 Google 标准表单并触发它的提交。

    【讨论】:

      猜你喜欢
      • 2011-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多