下面所显示的错误要怎么改?
XMLHttpRequest cannot load http://api.bing.com/qsonhs.aspx?q=w. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
代码如下:
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
<title>bing search</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();
});
</script>
</body>
</html>