靜態網站全站搜索功能

最近在百度發現一個靜態網站全站搜索的功能,記錄下來備用

 

http://www.baidu.com/search/freecode.html

 

 

<SCRIPT language=javascript>
function g(formname)	{
var url = "http://www.baidu.com/baidu";
if (formname.s[1].checked) {
	formname.ct.value = "2097152";
}
else {
	formname.ct.value = "0";
}
formname.action = url;
return true;
}
</SCRIPT>
<form name="f1" οnsubmit="return g(this)">
<table bgcolor="#FFFFFF" style="font-size:9pt;">
<tr height="60"><td valign="top"><img src="http://img.baidu.com/img/logo-137px.gif" border="0" alt="baidu"></td>
<td>
<input name=word size="30" maxlength="100">
<input type="submit" value="百度搜索"><br>
<input name=tn type=hidden value="bds">
<input name=cl type=hidden value="3">
<input name=ct type=hidden>
<input name=si type=hidden value="www.baidu.com">
<input name=s type=radio> 互聯網
<input name=s type=radio checked> www.baidu.com
</td></tr></table>
</form>
                                    


通過百度實現站內搜索功能,只需要用您的網站地址替換代碼中"www.baidu.com"即可。
提示:如果網頁採用utf-8代碼,則需要在代碼中加入<input name=ie type=hidden value=utf-8>,否則搜索關鍵詞會出現亂碼。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章