0

嗨,我有一个网页,想将谷歌搜索集成到该页面中。

你能指导我怎么做吗?

实际上我尝试了谷歌给出的代码。

像这样

<form action="http://www.duckyvideos.com" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-9481442241155955:7j2htu-qsi5" />
    <input type="hidden" name="cof" value="FORID:10" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="31" />
    <input type="submit" name="sa" value="Search" />
  </div>
</form>

<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script>


<div id="cse-search-results"></div>
<script type="text/javascript">
  var googleSearchIframeName = "cse-search-results";
  var googleSearchFormName = "cse-search-box";
  var googleSearchFrameWidth = 800;
  var googleSearchDomain = "www.google.com";
  var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>

我将上面的代码放在我的网页中。但它没有显示任何结果。

那有什么问题

4

1 回答 1

0

The most likely reason your CSE is not showing any results is because Google has not indexed your site yet. This may be the case even if your site is already showing up in regular search results (though if it doesn't show up in regular results, it definitely won't show up in the CSE).

You can verify this by using the test search functionality from the CSE control panel. If there are no results there, it's definitely nothing you're doing wrong.

Make sure Google's spider can find your pages, and wait a bit for them to be indexed, then try again.

于 2009-08-05T07:53:52.987 回答