百度搜索,带智能提示

<html>
<head>
<meta http-equiv=Content-Type content="text/html;charset=gb2312">
<title>百度搜索,带智能提示</title>
<style>
td,a
{font-family:arial}
#kw
{font:16px Verdana;height:1.78em;padding-top:2px}
#b
{height:30px;padding-top:4px}
#b,#b 0 3px!important;margin:0 0 10px}
#sb
{height:2em;width:5.6em}
#km
{height:50px}
#l
{margin:0 0 5px 15px}
#l td
{padding-left:107px}
p,table
{width:650px;border:0}
#l td,#sb,#km
{font-size:14px}
#l a,#l b
{margin-right:1.14em}
a
{color:#00c}
a:active
{color:#f60}
#hp
{position:absolute;margin-left:6px}
#lg
{margin:-26px 0-44px}
lk
{width:auto;line-height:18px;vertical-align:top}
form
{position:relative;z-index:9}
</style>
</head>
<body>
<form name=f action=http://www.baidu.com/s><input type=text name=wd id=kw size=35 maxlength=100>
<input type=hidden name=tn value="jqshw_pg"><input type=hidden name=bar value="">
<input type=submit value=百度一下 id=sb>
</form>
</body>

<script>
 
var w = document.f.wd;
 
function s(o)
 {
  
if (w.value.length > 0
   {
     
var h = o.href;
     
var q = encodeURIComponent(w.value);
     
if (h.indexOf("q="!= -1)
     {
       o.href 
= h.replace(new RegExp("q=[^&$]*"), "q=" + q)
     }
     
else
     {
       o.href 
+= "?q=" + q
     }
  }
 };

 (
function() 
    {
       
if (new RegExp("q=([^&]+)").test(location.search))
        {
         w.value 
= decodeURIComponent(RegExp.$1)
        }
    })();

  document.write(
'<script src=http://www.baidu.com/js/bdsug.js?v=1.1.0.3><\/script>')
  window.onunload 
= function() {};
</script>

<script>
 w.focus()
</script>
</html>
原文地址:https://www.cnblogs.com/linmilove/p/1512402.html