使用Google做自己的站内搜索
2011-07-08 00:00
423 查看
做网站,站内搜索是一个必不可少的功能。但是自己做搜索,如果要做好不容易,做得不完善又会加大服务器资源的开销,一个比较好的方法是借助Google做自己的站内搜索。有现成的强大的搜索在,自己也可以偷懒些。下面是对nowamagic.net的一个简单的站内搜索。
下面的搜索则可以搜全网,也可以站内,默认是站内。
搜互联网
站内搜索
<form action="http://www.google.com/search" method="get" target="_blank"> <input name="q" id="search" alt="Search" class="inputbox" type="text" size="20" value="要搜东西?" onblur="if(this.value=='') this.value='要搜东西?';" onfocus="if(this.value=='要搜东西?') this.value='';" /> <input name="sitesearch" value="www.nowamagic.net" type="hidden" /> <input type="submit" name="btnG" value="Google 搜索"> <!-- <input type="submit" value="查询" /> --> </form>
下面的搜索则可以搜全网,也可以站内,默认是站内。
搜互联网
站内搜索
<form method=get action="http://www.google.com/search" target="_blank"> <table bgcolor="#FFFFFF"> <tr> <td><a href="http://www.google.com/"> <img src="http://www.google.com/logos/Logo_40wht.gif" border="0" alt="Google"></a></td> <td> <input type="text" name="q"> <input type="hidden" name="hl" value="zh-CN"> <input type="submit" name="btnG" value="Google 搜索"> <input type="hidden" name="domains" value="www.nowamagic.net"> <br /> <input type="radio" name="sitesearch" value="">搜互联网 <input type="radio" name="sitesearch" value="www.nowamagic.net" checked>站内搜索 </td> </tr> </table> </form>
相关文章推荐
- 使用google搜索api做自己的搜索服务
- 使用google站内搜索
- 使用Google的Closure Compiler,在本机上压缩javascript
- google protobuf 使用心德
- Bing Maps中使用Google全球本地化搜索服务详解
- 一起学Netty(十)之 Netty使用Google的ProtoBuf
- 【安卓】google gsp 开发使用为了支持5.0以上的设备
- 使用 Google 高级搜索的一些技巧
- 32个使用 Google 网页字体的优秀网站案例
- 调用Google API做自己的翻译工具
- 教你如何使用 Google App Engine
- Google官方支持的MVVM架构框架Data Binding使用入门
- 在Google Blogger和Google App Engine使用自定义HTTPS
- Google免费GPU使用教程(亲测可用)
- MAC - 使用 Alfred 调用 Google 翻译
- 使用Google Cloud SDK来配置Google App Engine
- 最新使用google 2014年6月16日
- Google Guava Collections 使用介绍
- Google Protocol Buffer 的使用和原理
- google Guava Cache使用