位置:海鸟网 > IT > JavaScript >

用百度实现站内搜索的Javascript代码

<SCRIPT language=javascript>
<!--
function go(formname)
{
var url = "http://www.baidu.com/baidu";

formname.method = "get";
if (formname.myselectvalue.value == "1") {
document.search_form1.word.value = document.search_form1.word.value+" site:";
}
formname.action = url;
return true;
}
//-->
</SCRIPT>
<form target="_blank" >
<input name=word size="30" value="请输入关键字" onBlur="if (value ==''){value='请输入关键字'}" > Www_chinahtml_com
<input type="submit" value="搜索"><br>
<INPUT name=myselectvalue type=hidden value=0>
<INPUT name=tn type=hidden value="sayyes">
<INPUT name=cl type=hidden value="3">
<INPUT CHECKED name=myselect onclick=javascript:this.form.myselectvalue.value=0; type=radio value=0>

<FONT color=#0000cc>互联网
<INPUT name=myselect onclick=javascript:this.form.myselectvalue.value=1; type=radio value=1>
<FONT color=#ff0000>站内
</form>