mirror of
https://gitlab.com/buildfeed/BuildFeed.git
synced 2024-03-22 21:10:34 +08:00
15 lines
496 B
JavaScript
15 lines
496 B
JavaScript
$(function () {
|
|
$("#search-input").keyup(function () {
|
|
var search = $(this);
|
|
$(this).parent().find(".list-group").remove();
|
|
$.ajax("/api/GetSearchResult/?query=" + $(this).val()).done(function (data) {
|
|
var template = $.templates("#result-template");
|
|
var content = $("<div class='list-group'></div>");
|
|
|
|
var item = template.render(data);
|
|
content.append(item);
|
|
|
|
search.after(content);
|
|
});
|
|
});
|
|
}); |