<div class="codetitle"> <span><a style="CURSOR: pointer" data="64480" class="copybut" id="copybut64480" onclick="doCopy('code64480')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code64480"> <br> <br> <br> <br><title></title> <br><!--注意引用的插件,及顺序--> <br><link href="jquery.autocomplete.css" rel="stylesheet" type="text/css"> <br><script src="Jquery1.7.js" type="text/javascript"></script> <br><script src="jquery.autocomplete.js" type="text/javascript"></script> <br><script src="messages_cn.js" type="text/javascript"></script> <br><script type="text/javascript"> <BR>$(function () { <BR>var array = ['a', 'as', 'asd', 'bs', 'bd']; <BR>// 搜索获取选择的值 <BR>// $('#search').autocomplete(array).result(function (event, data) { <BR>// $('#Text1').val(data); <BR>// }); <BR>//智能感知连接外网搜索 <BR>$('#search').autocomplete(array).result(function (event, data) { <BR>window.location.href ='http://www.baidu.com/s?wd='+data+'+&rsv_spt=1&issp=1&rsv_bp=0&ie=utf-8&tn=56060048_pg&rsv_sug3=3&rsv_sug=0&rsv_sug1=3&rsv_sug4=172' <BR>}); <BR>}) <BR></script> <br> <br> <br><div> <br><input type="text" id="search"><input type="button" id="b1" value="搜索"><input type="text" id="Text1"> <br> </div> <br> <br> <br> </div>