我有一个ajax搜索,在你输入时过滤.它在chrome和firefox中运行良好.但是,无论您发送什么数据,IE总是返回相同的响应.这是为什么?以下是代码:
var cardSearch = $('<div>').addClass('card_search').appendTo($('body')).hide().css({'position': 'absolute','width': '350px','height': '300px','background': '#D5D5D5','padding': '10px'}).append( $('<div>').css({'background': 'whiteSmoke','padding': '5px','height': '290px','position': 'relative'}).append( $('<input>').css('width','250px').bind('keyup',function(e){ $.post('http://api.redemptionconnect.com/cards/find/?a=' + Math.random(),{data: {title: $(this).val(),limit: 10,page: 1}},function(r){ $('ul',cardSearch).empty(); for( var i = 0; i < r.data[0].length; i++ ) $('ul',cardSearch).append( $('<li>').append( $('<a>').attr('href','javascript:void(0)').html(r.data[0][i].Card.title + ' (' + r.data[0][i].CardSet.abbreviation + ')').attr('card_id',r.data[0][i].Card.id).mouSEOver(function(){showCardTooltip(this);}) ).css({'padding': '5px','border-bottom': '1px solid #ccc'}) ); },'json'); }),$('<button>').html('Search').css({'width': '70px','margin-left': '10px'}),$('<hr>').css('margin-bottom',0),$('<ul>').css({ 'list-style-type': 'none','margin': 0,'padding': 0,'width': '100%' }) ) );
在chrome和firefox中,输出是正确的.在IE中,无论您键入什么,输出始终都是相同的.我不确定还包括什么.您可以在http://redforum.blackfireweb.com看到它工作,然后单击“搜索卡”菜单按钮.