用google的搜索功能对相关网站进行搜索,并对搜索框进行相应的设置
2011-02-09 14:10
609 查看
javascript代码:
网页内容:
function checkinput() { var googleinput=document.getElementById("googleinput"); if (googleinput.value.length<=0 || googleinput.value=="请输入你想查询的内容") { alert("请输入你想查找的内容"); googleinput.focus(); return false; } else{ setTimeout("clearit()",1000); //1秒之后对文本框中的内容进行清空 return true; } } function clearit(){ var googleinput=document.getElementById("googleinput"); googleinput.value=""; } function inputfocus(){ var googleinput=document.getElementById("googleinput"); googleinput.style.color="#000"; if(googleinput.value=="请输入你想查询的内容"){ googleinput.value=""; } } function inputblur(){ var googleinput=document.getElementById("googleinput"); if(googleinput.value.length<=0){ googleinput.value="请输入你想查询的内容"; googleinput.style.color="#999"; } }
网页内容:
<form name="google" action="http://www.google.com.hk/search" method="get" onsubmit="return checkinput();"> <input type="hidden" value="zh-CN" name="hl" /> <input type="hidden" value="zh-CN" name="inlang" /> <input type="hidden" value="GB2312" name="ie" /> <input type="hidden" value="GB2312" name="oe" /> <input type="hidden" value="www.anchao.org.cn" name="domains" /> <input type="hidden" value="www.anchao.org.cn" name="sitesearch" /> <input type="text" id="googleinput" name="q" onfocus="inputfocus()" onblur="inputblur()" style="color:#999;" mce_style="color:#999;" value="请输入你想查询的内容" autocomplete="off" class="search" /> <input name="cx" type="submit" value="查询" /> </form>
相关文章推荐
- ShopEx customSchema 定制可以根据客户的需求对网站进行相应功能的添加修改或者删除
- 网站搜索框添加语音搜索功能
- 如何将网站的搜索功能加入到浏览器的搜索框 (IE7/FF2)
- java简单的实现搜索框的下拉显示相关搜索功能
- 在你的网站中嵌入搜索功能-百度和google
- 网站没有搜索引擎?没关系,google百度帮你忙--站点搜索功能
- 使用Google Geocoding API来进行关键字搜索,获取相关的地理位置信息
- FSO组件不可用,各种与FSO相关的功能都将出错!请运行Install.asp或者到后台网站配置处设置好FSO组件名称。或无法使用vbscript
- iOS 打包上传AppStore相关(3)-iTunes相应配置以及使用蒲公英网站进行应用托管分发(链接/二维码)
- 简单设置,去掉google搜索中对关键词的过滤功能
- 简单设置,去掉google搜索中对关键词的过滤功能
- 网站加入Google搜索功能 嵌入Google搜索
- 实现类似于google,baidu的搜索提示功能,带有上下键选择功能
- 关于nginx根据url进行负载分配即location部分的相关设置
- Google网站分析工具功能详解
- 与云计算相关的google论文链接以及Hadoop开源网站
- dede如何添加搜索功能, 让网站支持搜索
- 自定义扩展名的文件在eclipse中如何设置相应的插件进行查看
- 强大的Google搜索功能