2010-10-01 95 views
3

我想同時它獲取XML文件到這個CSS應用到搜索框。目前加載該文件需要大約3秒鐘的時間。jQuery用戶界面自動完成 - 的.ui-自動完成裝載

我在autocomplete.js看到文件這兩個函數:

_search: function(value) { 
    this.term = this.element 
     .addClass("ui-autocomplete-loading") 
     // always save the actual value, not the one passed as an argument 
     .val(); 

    this.source({ term: value }, this.response); 
}, 

_response: function(content) { 
    if (content.length) { 
     content = this._normalize(content); 
     this._suggest(content); 
     this._trigger("open"); 
    } else { 
     this.close(); 
    } 
    this.element.removeClass("ui-autocomplete-loading"); 
}, 

我只是不知道如何以及在何處觸發,在我的代碼。

感謝

回答

1
$("#name").addClass("ui-autocomplete-loading"); 

做到了,.removeclass刪除它