2013-02-20 85 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