CSDN博客

img zhangzs8896

有关"集成搜索"的javascript代码

发表于2004/10/12 11:44:00  809人阅读

<script>
<!--//Begin JavaScript Source
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name != 'chkall')
e.checked = form.chkall.checked;
}
}
function netsearch(formname)
{
var Sina1
var Sina2
var Sohu1
var Sohu2
var Netease1
var Netease2
var baidu1
var baidu2
var mp31
var mp32
var sbox1
var sbox2
var flash1
var flash2
var YahooC1
var YahooC2
var Google1
var Google2
var tom1
var tom2
var TEXT
var noENGINE
var haveTEXT

TEXT=formname.TEXT.value;
noEngine=true;
haveTEXT=true;

if (TEXT=="")
{
alert("请输入搜索内容!")
haveTEXT=false
}

Sina1=formname.Sina.checked;
Sina2="http://search.sina.com.cn/cgi-bin/search/search.cgi?_searchkey="+TEXT;
if (Sina1)
{
noEngine=false
if (haveTEXT)
{
newWindow=window.open(Sina2, "Sina","toolbar,location,directories,status,menubar,scrollbars,resizable=1")
}
}

Sohu1=formname.Sohu.checked;
Sohu2="http://site.search.sohu.com/sitesearch.jsp?key_word="+TEXT;
if (Sohu1)
{
noEngine=false
if (haveTEXT)
{
newWindow=window.open(Sohu2, "Sohu","toolbar,location,directories,status,menubar,scrollbars,resizable=1")
}
}
Netease1=formname.Netease.checked;
Netease2="http://nisearch.163.com/Search?q="+TEXT;
if (Netease1)
{
noEngine=false
if (haveTEXT)
{
newWindow=window.open(Netease2, "Netease","toolbar,location,directories,status,menubar,scrollbars,resizable=1")
}
}

baidu1=formname.baidu.checked;
baidu2="http://www1.baidu.com/baidu?myselectvalue=0&tn=net900&word="+TEXT;
if (baidu1)
{
noEngine=false
if (haveTEXT)
{
newWindow=window.open(baidu2, "baidu","toolbar,location,directories,status,menubar,scrollbars,resizable=1")
}
}
 
mp31=formname.mp3.checked;
mp32="http://mp3search.baidu.com/wstsearch?tn=baidump3&ct=134217728&word="+TEXT;
if (mp31)
{
noEngine=false
if (haveTEXT)
{
newWindow=window.open(mp32, "mp3","toolbar,location,directories,status,menubar,scrollbars,resizable=1")
}
}
 
YahooC1=formname.YahooC.checked;
YahooC2="http://cn.search.yahoo.com/search/cn?p="+TEXT;
if (YahooC1)
{
noEngine=false
if (haveTEXT)
{
newWindow=window.open(YahooC2, "YahooC", "toolbar,location,directories,status,menubar,scrollbars,resizable=1")
}
}

 
Google1=formname.Google.checked;
Google2="http://google.cn76.com/search?hl=zh-CN&q="+TEXT;
if (Google1)
{
noEngine=false
if (haveTEXT)
{
newWindow=window.open(Google2, "n","toolbar,location,directories,status,menubar,scrollbars,resizable=1")
}
}
 

sbox1=formname.sbox.checked;
sbox2="http://union.3721.com/search_result.htm?oid=&e=&pid=S_cn76_2605&fw=union&argse=new3721&name="+TEXT;
if (sbox1)
{
noEngine=false
if (haveTEXT)
{
newWindow=window.open(sbox2, "sbox","toolbar,location,directories,status,menubar,scrollbars,resizable=1")
}
}
tom1=formname.tom.checked;
tom2="http://sms2.ctn.com.cn/smslist/smsearch.php?user_id=67&inc=3&keyword="+TEXT;
if (tom1)
{
noEngine=false
if (haveTEXT)
{
newWindow=window.open(tom2, "tom","toolbar,location,directories,status,menubar,scrollbars,resizable=1")
}
}
flash1=formname.flash.checked;
flash2="http://flash.baidu.com/wstsearch?tn=flash&ct=33554432&word="+TEXT;
if (flash1)
{
noEngine=false
if (haveTEXT)
{
newWindow=window.open(flash2, "flash","toolbar,location,directories,status,menubar,scrollbars,resizable=1")
}
}

if (noEngine)
{
alert("请选择搜索引擎!")
}
}
//End JavaScript Source -->
</script>
<table style='width:760px; background-color: #FFFF00; layer-background-color: #CCCCCC; border: 1px none #000000'><tr><td><font style='FONT-SIZE:9pt'>集成搜索</td><td><form name=engines onSubmit=netsearch(engines)><input style='background-color: FDF3D1; border: 1px solid #FBB723' name=TEXT size=10 maxlength=200 value=> <input type=button style='BACKGROUND-COLOR:#ffffff;BORDER-BOTTOM:red 1px solid;BORDER-LEFT:red 1px solid;BORDER-RIGHT:red 1px solid;BORDER-TOP:red 1px solid;COLOR:#000000;FONT-SIZE:9pt' value=搜索 name=Submit onClick=netsearch(engines)><font style='FONT-SIZE:9pt'> <input type=Checkbox name=baidu checked>百度<input type=Checkbox name=Google checked>Google<input type=Checkbox name=YahooC>雅虎<input type=Checkbox name=Sina>新浪<input type=Checkbox name=Sohu>搜狐<input type=Checkbox name=Netease>网易<input type=Checkbox name=sbox>网络实名<input type=Checkbox name=tom>手机铃声<input type=Checkbox name=flash>FLASH<input type=Checkbox name=mp3>MP3</font></td></form></tr></table>
</font>

以上代码加在<body>区域即可

阅读全文
0 0

相关文章推荐

img
取 消
img