BuildFeed/Scripts/bfs.js

15 lines
497 B
JavaScript
Raw Normal View History

2014-11-28 03:34:20 +08:00
$(function () {
$("#search-input").change(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);
});
});
});