最赞回答 / mop18mop183811015
这个没有跨域。还是看评论,可以通过 jsonp的ajax方式来实现。$.ajax({ type:'get', async:true, url:"http://api.bing.com/qsonhs.aspx?type=cb&q="+searchText, dataType:"jsonp", jsonp:'cb', jsonpCallBack:"callback",success:function(d){...},error:function(){}});
2017-05-23
success:function(d){
var list=$(d.AS.Results[0].Suggests);
list.each(function(index,item){
html+="<li><a target='_blank' href='"+item.Url+"'>"+item.Txt+"</a></li>";
});
$('#search-result').html(html);
$('#search-suggest').show();
},
error:function(){alert('err');}
var list=$(d.AS.Results[0].Suggests);
list.each(function(index,item){
html+="<li><a target='_blank' href='"+item.Url+"'>"+item.Txt+"</a></li>";
});
$('#search-result').html(html);
$('#search-suggest').show();
},
error:function(){alert('err');}
2017-05-22