BuildFeed/Scripts/bfs.js
2014-12-03 10:54:14 +00:00

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