日期:2014-05-17  浏览次数:20518 次

js实现站内搜索
HTML code
<div style="width: 233px; height: 40px; background-color: #d2e4f2">
    <div align="center" style="margin-top: 4px">
        <table>
            <tbody>
                <tr>
                    <td>
                        <select name="sel"><option selected="selected">标题</option><option>作者</option></select></td>
                    <td>
                        <input id="txt" name="wq" size="6" style="width: 100px; height: 17px" width="10" /></td>
                    <td>
                        <img alt="" height:="" onclick="javascript:baidusearch()" src="/port/upload/images/search.png" style="cursor: hand" /></td>
                </tr>
            </tbody>
        </table>
    </div>
</div>

JScript code
<script language="javascript">
function baidusearch () {
var wd=document.getElementsByName("wq")[0].value;
var link="http://www.baidu.com/s?si=www.fzlsk.com&cl=3&ct=2097152&tn=baidulocal&word="+wd;
window.open(link); }
</script>

我的这个搜索只是实现要跳到百度,然后点击才到搜索!怎么实现直接在站内的!

------解决方案--------------------
囧……?你想怎么实现?这种搜索只能这样了,要不用个iframe嵌入到页面中去?
------解决方案--------------------
可以不经过baidu跳转的我也想知道=v=

我直接访问不是乱码
------解决方案--------------------
听说很复杂
------解决方案--------------------

http://www.baidu.com/search/freecode.html
是这个么 里面有乱码处理
------解决方案--------------------
Lucene.net站内搜索
sql server全文检索
js通过web servives等获取数据
------解决方案--------------------
Lucene.net站内搜索
------解决方案--------------------
光靠js不能做出搜索的
------解决方案--------------------
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
</head>