在博客中添加Google站内自定义搜索按钮

2009年4月25日

之前写过一篇在博客中添加搜索按钮的帖子,今天再向大家推荐一种最直接最实用的办法。只要在博客中新建HTML/JavaScript脚本,然后直接输入一下代码就可以了。怎么样,简单吧,那就动手吧!

<!-- SiteSearch Google -->
<form method="get"
action="http://www.google.cn/custom"
target="google_window">
<table border="0"
bgcolor="#eeeade">
<tr><td nowrap="nowrap"
valign="top" align="left" height="32">
<input type="hidden"
name="domains" value="buboos.blogspot.com"></input>
<label for="sbi" style="display:
none">输入您的搜索字词</label>
<input type="text"
name="q" size="6" maxlength="255" value=""
id="sbi"></input>
<label for="sbb"
style="display: none">提交搜索表单</label>
<input
type="submit" name="sa" value="Google 搜索" id="sbb"></input>
</td></tr>
<tr>
<td
nowrap="nowrap">
<table>
<tr>
<td>
<input type="radio" name="sitesearch" value=""
id="ss0"></input>
<label for="ss0"
title="搜索网络"><font size="-2"
color="black">Web</font></label></td>
<td>
<input type="radio" name="sitesearch"
value="buboos.blogspot.com"
checked id="ss1"></input>
<label for="ss1"
title="搜索 buboos.blogspot.com"><font
size="-2"
color="black">buboos.blogspot.com</font></label></td>
</tr>
</table>
<input
type="hidden" name="client"
value="pub-8464600688944785"></input>
<input
type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie"
value="UTF-8"></input>
<input type="hidden"
name="oe" value="UTF-8"></input>
<input
type="hidden" name="safe" value="active"></input>
<input type="hidden" name="flav"
value="0000"></input>
<input type="hidden"
name="sig" value="94pc4GLx1bwfTZSC"></input>
<input type="hidden" name="cof"
value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1"></input>
<input type="hidden" name="hl"
value="zh-CN"></input>
</td></tr></table>
</form>
<!-- SiteSearch Google -->

样式:

注意:要将红色部分换成你自己博客的地址(要省略http://)
可以根据博客风格颜色修改一些属性,如蓝色部分bgcolor="#eeeade">的改动就能实现搜索框背景颜色的改变。

原创文章,引用请注明出处布波博客 http://buboos.blogspot.com/

相关文章

0 评论:

发表评论