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; 
    } 
}); 

:

어쩌면 특별히 ,{ q: get.term; },

에서이 문제를 해결하기 위해 당신이 어떤 생각을 가지고 있습니까

$.getJSON('rom_new_php_recup.php?action=big_search',{ q: get.term; }, function(result) 
? 감사합니다. Romain

답변

1

get.term 다음에 세미콜론을 제거하십시오. IE는 JSON을 처리 할 때 악명이 높습니다.

+1

당신이 최고입니다,이 완벽하게 작동합니다! – lahud

관련 문제