博客园  :: 首页  :: 联系 :: 订阅 订阅  :: 管理

利用搜索引擎实现站内搜索.html

Posted on 2006-04-23 13:57  ╁蓝驿┲→  阅读(327)  评论(0编辑  收藏  举报

利用搜索引擎实现站内搜索.html
保存为html就可以使用
<html>
<head>
<SCRIPT language=javascript>

//------------------------------

  function check(form1)
    {  if(theform.key.value=="")
       { alert("请输入您要搜索的内容!");
         theform.key.focus();
         return (false);
        }
       return (true);
    }
function winopen(thefile,item,value,thewidth,theheight)
   { filename=thefile+".asp?"+item+"="+value
    window.open(filename,"","width="+thewidth+","+"height="+theheight+","+"resizable=0"); }
function winopen1(theUrl,thewidth,theheight)
    {window.open (theUrl, "newwindow", "height=115, width=580,top=200,left=80,toolbar=no,menubar=no, scrollbars=no, resizable=no, location=no, status=no"); } 

function search4()
{
if(form1.abc6.checked)
   window.open("http://www.google.com/search?ie=GB2312&oe=GB2312&hl=zh-CN&lr=lang_zh-CN&q="+form1.key.value,"mspg6");
if(form1.abc9.checked)
   window.open("http://www.baidu.com/baidu?tn=ebeihai&word="+form1.key.value,"mspg9");
if(form1.abc9a.checked)
   window.open("http://www.yisou.com/search?lang=zh-cn%2Czh-tw&p="+form1.key.value,"mspg9a");
if(form1.abc9b.checked)
   window.open("http://page.zhongsou.com/zspage.cgi?word="+form1.key.value,"mspg9b");

if(form1.abc0.checked)
   window.open("http://search.sina.com.cn/cgi-bin/search/search.cgi?_searchkey="+form1.key.value,"mspg0");
if(form1.abc1.checked)
   //window.open("http://site.search.sohu.com/sitesearch.jsp?page_index=0&key_word="+form1.key.value,"mspg1");
   window.open("http://www.sogou.com/web?query="+form1.key.value,"mspg1");
if(form1.abc2.checked)
   window.open("http://cn.search.yahoo.com/search/cn?p="+form1.key.value,"mspg2");
if(form1.abc4.checked)
   window.open("http://cns.3721.com/cns.dll?name="+form1.key.value,"mspg4");
if(form1.abc5.checked)
   //window.open("http://search.yahoo.com/bin/search?p="+form1.key.value,"mspg5");
   window.open("http://search.msn.com/results.aspx?q="+form1.key.value+ "&FORM=QBRE","mspg5");
return false;  
}
</SCRIPT>
</head>
<body>
<TABLE cellSpacing=0 cellPadding=0 width=765 align=center border=0>
  <FORM name=form1 onsubmit=return(search4())>
  <TBODY>
  <TR>
    <TD align=middle bgColor=#99cccc height=23>
      <P><SPAN class=style1>搜索:</SPAN> <INPUT style="FONT-SIZE: 12px" name=key> <INPUT style="FONT-SIZE: 12px; BACKGROUND: #cccccc" type=submit value=搜索 name=B1>
      <INPUT type=checkbox CHECKED value=google name=abc6> <A
      href="http://www.google.com/">Google</A> <INPUT type=checkbox CHECKED
      value=baidu name=abc9> <A href="http://www.baidu.com/">百度</A> <INPUT
      type=checkbox value=yisou name=abc9a> <A
      href="http://www.yisou.com/">一搜</A> <INPUT type=checkbox value=zhongsou
      name=abc9b> <A href="http://www.zhongsou.com/">中搜</A> <INPUT type=checkbox
      value=sina name=abc0> <A href="http://www.iask.com/">新浪</A> <INPUT
      type=checkbox value=sohu name=abc1> <A href="http://www.sogou.com/">搜狗</A>
      <INPUT type=checkbox value=yahoo name=abc2> <A
      href="http://www.yahoo.com.cn/">雅虎</A> <INPUT type=checkbox value=3721
      name=abc4> <A href="http://www.3721.com/">3721</A> <INPUT type=checkbox
      value=MSN name=abc5> <A href="http://www.msn.com.cn/">MSN</A>
  </P></TD></TR></FORM></TBODY></TABLE>
</body>
</html>