百度搜索开发

来源:互联网 发布:pickit2烧写软件 编辑:程序博客网 时间:2024/05/22 03:49
“`百度一下,你就知道#ul1{ width:542px; border:1px solid #ccc; position:absolute; left:0; border-top:none; display:none;}#ul1 li{ height:30px; line-height:30px; text-align:left;text-indent:5px;}#ul1 li.on{ background:#eee;}window.onload=function(){ var oT=document.getElementById('t1'); var oUl=document.getElementById('ul1'); var oBtn=document.getElementById('btn1'); var iNow=-1; var oldValue=''; // oT.onkeyup=function(ev){ var oEvent=ev || event; if(oEvent.keyCode==40 || oEvent.keyCode==38)return; //回车搜索 if(oEvent.keyCode==13){ window.open('https://www.baidu.com/s?wd='+oT.value,'_self'); oT.value=''; } jsonp({ url:'https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su', data:{wd:oT.value}, success:function(json){ var arr=json.s; oUl.innerHTML=''; if(arr.length){ oUl.style.display='block'; }else{ oUl.style.display='none'; } for(var i=0; i
0 0