我的搜索提示框没有显示出来,大家帮我看看哪里需要改一下?
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
<title>必应</title>
<link rel="stylesheet" type="text/css" href="test.css">
</head>
<body>
<div class="bg">
<div class="search-box">
<div class="logo"></div>
<form class="search-form" id="search-form" action="https://cn.bing.com/search" target="_blank">
<input type="text" class="search-input-text" name="q" id="search-input" autocomplete="off"/>
<input type="submit" value="" class="search-input-button"/>
</form>
</div>
</div>
<div class="suggest" id="search-suggest" style="display:none">
<ul id="search-result">
<li>手机</li>
<li>手机游戏</li>
<li>手机APP</li>
<li>手机铃声</li>
<li>手机主题</li>
</ul>
</div>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$('#search-input').bind('keyup',function(){
var searchText=$('#search-input').val();//获取用户输入的值
$.get('http://api.bing.com/qsonhs.aspx?q='+searchText,function(d){
var d=d.AS.Results[0].Suggests;
//获取suggest中的数据
var html='';//动态
//获取到的数据进行for循环
for(var i=o;i<d.length;i++){
html+='<li>'+d[i].Txt+'</li>';
}//获取的数据放在li中
$('#search-result').html(html);
$('#search-suggest').show().css({
top:$('#search-form').offset().top+$('#search-form').height()+10,
left:$('#search-form').offset().left,
position:'absolute'
});
},'josn');//$.get(url,callback,'json')
});
$(document).bind('click',function(){
$('#search-suggest').hide();
});
$(document).delegate('li','click',function(){
var keyword=$(this).text();
location.href='http://cn.bing.com/search?q='+keyword;
});