【问题标题】:How to use Filter in Google Search?如何在 Google 搜索中使用过滤器?
【发布时间】:2010-08-19 22:14:50
【问题描述】:

我已使用以下方法将文本框搜索转换为 Google 搜索:

location.href = "http://images.google.com/search?q=" + val;

但是,我想要网页搜索、图片搜索、本地搜索和新闻搜索选项。

我确实有:

<tr height="40">
<td width="80%" align="center" ><input id="searchText" type="text" size="100"/></td>
<td class="searchbox" width="20%" align="center"><a href="#" onclick="startSearch()">Search</a></td>
<td width="0%"></td>
</tr>

<td align="center">
<input type="radio" name="searchType" value="true"/> Web
<input type="radio" name="searchType" value="false"/> Image
<input type="radio" name="searchType" value="false"/> News
<input type="radio" name="searchType" value="false"/> Local
</td>

如何使用上述链接过滤此选项。

【问题讨论】:

    标签: javascript html google-search


    【解决方案1】:

    首先,你真的应该考虑使用Google Search API,它会给你更多的权力和控制。

    但是,如果您需要快速而肮脏的东西,您可能需要在连接查询之前选择 URL。以下是网址:

    "http://www.google.com/maps?q=" + val;
    "http://www.google.com/images?q=" + val;
    "http://www.google.com/news?q=" + val;
    

    等等。

    所以也许要做的事情是维护一个包含当前搜索 URL 的全局变量,然后在每个单选按钮的 onclick 函数中更改该变量。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-22
      • 2021-12-18
      • 1970-01-01
      • 2019-01-10
      • 1970-01-01
      相关资源
      最近更新 更多