2

这是我在网站上的第一个问题,但我有一个真正的问题。林重写我的网站的代码,使其在IE浏览器...而在IE8仅此代码,多输入自动完成崩溃:UI自动完成和IE8

$.widget("custom.catcomplete", $.ui.autocomplete, 
{ 
    _renderMenu: function(ul, items) 
    { 
     var that = this, 
     currentCategory = ""; 
     $.each(items, function(index, item) 
     { 
      if (item.category != currentCategory) { 
       ul.append("<li class='ui-autocomplete-category'>" + item.category + "</li>"); 
       currentCategory = item.category; 
      } 
      that._renderItemData(ul, item); 
     }); 
    } 
}); 
$("#form_rech").catcomplete({ 
    source: function(get, response) { 
     $.getJSON('rom_new_php_recup.php?action=big_search',{ q: get.term; }, function(result) { 
      response($.map(result, function(item) { 
       return { 
        label: item.label.replace(/\\\'/g,"'"), 
        category: item.category, 
        hash: item.hash 
       } 
      })); 
     }); 
    }, 
    select: function(event, ui) { 
     document.location.hash = ui.item.hash; 
    } 
}); 

后EA几个测试中,它的接缝吨来自行:

$.getJSON('rom_new_php_recup.php?action=big_search',{ q: get.term; }, function(result) 

而且从,{ q: get.term; },

也许特意你有什么想法纠正呢? 非常感谢! Romain

回答

1

尝试在get.term后删除分号。 IE在处理JSON时非常严格。

+1

你是最棒的,这完美的作品! – lahud