【问题标题】:How to Embed Google Search如何嵌入谷歌搜索
【发布时间】:2015-11-29 00:29:04
【问题描述】:

我一直想知道如何在网页中嵌入 Google。是否可以将其放在iframe 中?我知道有些网站使用 Google CSE,但我想要真正的 Google。如果是这样,我该怎么做?

【问题讨论】:

    标签: javascript html web


    【解决方案1】:

    您可以将this URL(又名https://www.google.com/webhp?igu=1&gws_rd=ssl)嵌入iframe,而不会失败。 ?igu=1 是它的工作原理。我从agoogleaday.com 找到了这个答案,它使用iframe 来容纳一个实验性的Google 搜索网站。

    <iframe src="https://www.google.com/webhp?igu=1&gws_rd=ssl" width="640" height="480" frameborder="0">Your browser does not support <code>iframe</code>s. Please consider using a <a href="http://browsehappy.com/">modern</a> browser.</iframe>

    【讨论】:

      【解决方案2】:

      【讨论】:

        【解决方案3】:

        如果您不想要 google 徽标而只想要搜索框,您可以使用这个:

        <form target="_self" id="google" method="get" action="http://www.google.com/search" target="main" onsubmit="window.top.close();">
            <input name="q" id="google" placeholder="Google Search" size="40" maxlength="2000" value="" type="text" autofocus></input>
        </form>

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2018-11-02
          • 2021-12-28
          • 1970-01-01
          • 1970-01-01
          • 2011-12-29
          • 2019-09-19
          相关资源
          最近更新 更多