2013-02-20 110 views
1

我的页面顶部有一个GET表单,但尚未配置。我所有的是这样的:Google自定义格式的自定义表格

<div class="top-search"> 
     <form method="get" id="searchform" action="#"> 
      <div> 
       <input type="text" value="Search..." name="s" id="s" onfocus="defaultInput(this)" onblur="clearInput(this)" /> 
       <input type="submit" id="searchsubmit" value=" " /> 
      </div> 
     </form> 
    </div> 

我该如何操纵它以使用Google CSE?

回答

3

似乎没有人决定回答它,我发现了我自己。

<div class="top-search"> 
     <form id="searchform" action="http://www.google.com/cse"> 
      <div> 
       <input type="hidden" name="cx" value="xxxx" /> 
       <input type="hidden" name="ie" value="UTF-8" /> 
       <input type="text" value="" name="q" id="q" autocomplete="off" /> 
       <input type="submit" id="searchsubmit" name="sa" value=" " /> 
      </div> 
     </form> 

    </div> 

其中“XXXX”是你的搜索引擎的唯一ID,你的控制面板的基本页面上找到。

+0

感谢您的支持。这是一个很好的开始。谷歌cse似乎是任何网站的合理选择,看作谷歌索引您的网站。输出的代码是雷区,这真是太遗憾了。现在我需要取消关联样式表 – onebitrocket 2014-03-27 17:22:45