HTML 不引人注目的Google自定义搜索

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTML 不引人注目的Google自定义搜索相关的知识,希望对你有一定的参考价值。

<div id="site-search" class="box">
    <div class="hd">
        <h1>Site Search</h1>
        <form id="cse-search-box" action="http://google.com">
            <input type="hidden" name="cref" value="http://yourdomain.com/cref-cse.xml" />
            <input type="hidden" name="cof" value="FORID:11" />
            <input type="text" name="q" tabindex="0" />
            <button class="cmd" type="submit" name="sa" value="Search" accesskey="s" >
                <strong class="accesskey">S</strong>earch
            </button>
        </form>
    </div>
    <div id="cse-search-results" class="bd"></div>
    <div class="ft">
        <!-- Google CSE Init -->
        <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
        <script type="text/javascript">
            var cseSearchResultsHost = "";
            var googleSearchIframeName = "cse-search-results";
            var googleSearchFormName = "cse-search-box";
            var googleSearchFrameWidth = 800;
            var googleSearchDomain = "www.google.com";
            var googleSearchPath = "/cse";
            document.getElementById(googleSearchFormName).action = cseSearchResultsHost;
        </script>
        <script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
        <!-- End CSE Init -->
        <p>Powered by Google Custom Search.</p>
    </div>
</div>

HTML 来自链接列表的Google自定义搜索引擎

<!-- Use of this code assumes agreement with the Google Custom Search Terms of Service. -->
<!-- The terms of service are available at /coop/docs/cse/tos.html -->
<form name="cse" id="searchbox_demo" action="http://www.google.com/cse">
  <input type="hidden" name="cref" value="" />
  <input name="q" type="text" size="40" />
  <input type="submit" name="sa" value="Search" />
</form>
<script type="text/javascript" src="http://www.google.com/cse/tools/onthefly?form=searchbox_demo"></script>

以上是关于HTML 不引人注目的Google自定义搜索的主要内容,如果未能解决你的问题,请参考以下文章

HTML 来自链接列表的Google自定义搜索引擎

自定义 jquery 验证和不显眼的 JavaScript

自定义 jquery 验证和不显眼的 JavaScript

如何使用自定义搜索来获取 html 文件中的数据?

解析Google自定义搜索API Swift

Google 自定义搜索自动填充功能仅针对选定的字词