2011-04-21 5 views
2

jquery UI 자동 완성에 문제가 있습니다 ... 단어 입력을 시작하면 자동 완성 기능이 단어를 완성하기 전에 문자를 지우기 시작하는 결과를 보여줍니다 ... 누군가이 문제가 있습니까?jquery UI 타이핑 문제 자동 완성

$(function() { 
var rn = Math.floor(Math.random() * 11); 
$("#query").autocomplete({ 
    source: "search.asp?rn=" + rn, 
    minLength: 2, 
    selectFirst: true, 
    delay: 500, 
    //autoFocus: true, 
    select: function(event, ui) { 
     var vp = ui.item.vp; 
     var ran = Math.floor(Math.random() * 11); 
     if (vp != "-1" && vp != "x") { 
      location.href = "menu.asp?rn=" + ran + "&LOC=1&IDP=" + vp; 
     } 
     else if (vp == 'x') { 
      location.href = "result.asp?rn=" + ran + "&term=" + ui.item.value; 
     } 
    } 
}); 

$.ui.autocomplete.prototype._renderItem = function(ul, item) { 
    var sterm = this.term.split(" "); 
    $.each(sterm, function(index, value) { 
     item.label = item.label.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(value) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<span style='color: #2779AA;'><strong>$1</strong></span>"); 
    }); 
    return $("<li></li>").data("item.autocomplete", item).append("<a>" + item.label + "</a>").appendTo(ul); 
}; 

});

+0

저도 같은 문제가 발생. 이 문제를 해결할 방법을 찾아 냈나요? – Thomas

답변