- 1、本文档共5页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
站内搜索代码
直接粘在页面中即可使用:
form method=get action=/search
input type=text name=q
input type=submit name=btnG value=Google 搜索
input type=hidden name=ie value=GB2312
input type=hidden name=oe value=GB2312
input type=hidden name=hl value=zh-CN
input type=hidden name=domains value=
input type=hidden name=sitesearch value=
/form
!--Google站内搜索结束--
注意:请根据自己网站编码而更改搜索代码中的编码,如:UTF-8、GB2312等。
!--Baidu站内搜索开始--
form action=/baidu
input type=text name=word
input type=submit value=Baidu 搜索
input name=tn type=hidden value=bds
input name=cl type=hidden value=3
input name=ct type=hidden value=2097152
input name=si type=hidden value=
/form
!--Baidu站内搜索结束--
!--Yahoo站内搜索开始--
form action=/search
input type=text name=p
input type=submit value=Yahoo 搜索
input type=hidden name=vs value=
/form
!--Yahoo站内搜索结束--
下面是Google和百度的Javascript版的站内搜索代码:
!--Google站内搜索开始--
script type=text/javascript
function googlesearch () {
var wq=document.getElementsByName(wq)[0].value;
var link=/search?domains=sitesearch=q=+wq;
window.open(link); }
/script
input type=text name=wq/input type=submit onclick=javascript:googlesearch() value=Google 搜索 /
!--Google站内搜索结束--
!--Baidu站内搜索开始--
script language=javascript
function baidusearch () {
var wd=document.getElementsByName(wd)[0].value;
var link=/s?si=cl=3ct=2097152tn=baidulocalword=+wd;
window.open(link); }
/script
input type=text name=wd/input type=submit onclick=javascript:baidusearch() value=Baidu 搜索 /
!--Baidu站内搜索结束--
!--利用各种搜索引擎--
%@ Page Language=C# AutoEventWireup=true CodeFile=Default.aspx.cs Inherits=_Default %
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN /TR/xhtml1/DTD/xhtml1-transitional.dtd
html xmlns=/1999/xhtml
head
meta http-equiv=Content-Type content=text/html; charset=utf-8 /
title站内搜索/title
/head
body
script type=text/javascript language=javascript
function search4() {
if (form1.abc0.checked)
window.open(/cgi-bin/search/search.cgi?_searchkey= + form1.key.value, mspg0);
if (form1.abc1.checked)
window.o
文档评论(0)