Skip to content

Commit 9c28d22

Browse files
committed
updated 问题修复
1 parent 072bf9b commit 9c28d22

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

code/jquery.suggestion.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
var $box = $this.parent();
8787
var $suggestion = $("<div class='"+options.suggestionCls+"'><ul></ul></div>").appendTo($box);
8888
var $list = $suggestion.find('ul');
89-
var $item = $list.find('li');
89+
var $items = $list.find('li');
9090
var _height = $this.outerHeight(false);
9191
var _width = $this.outerWidth(false);
9292
var _text = null;
@@ -209,8 +209,8 @@
209209
// 成功后的回调函数
210210
var success = function(data){
211211
var list = options.onCallback.bind(_)(data);
212+
$list.empty();
212213
if(list&&list.length){
213-
$list.empty();
214214
list.forEach(function(item){
215215
$list.append('<li data-value="'+item['value']+'" data-name="'+item['name']+'">'+options.itemFormat(item)+'</li>');
216216
});
@@ -313,4 +313,4 @@
313313
getApi(_api);
314314
});
315315
};
316-
}));
316+
}));

0 commit comments

Comments
 (0)