$(function(){
$('#search').keyup(function() {
$.ajax({
type: "POST",
url: "/search/",
data: {
'search_text' : $('#search').val(),
'csrfmiddlewaretoken' : $("input[name=csrfmiddlewaretoken]").val()
},
success: searchSuccess,
dataType: 'html'
});
});
});
function searchSuccess(data, textStatus, jqXHR)
{
$('#search-results').html(data);
}
JChmdW5jdGlvbigpewogICAgJCgnI3NlYXJjaCcpLmtleXVwKGZ1bmN0aW9uKCkgewogICAgICAgICQuYWpheCh7CiAgICAgICAgICAgIHR5cGU6ICJQT1NUIiwKICAgICAgICAgICAgdXJsOiAiL3NlYXJjaC8iLAogICAgICAgICAgICBkYXRhOiB7CiAgICAgICAgICAgICAgICAnc2VhcmNoX3RleHQnIDogJCgnI3NlYXJjaCcpLnZhbCgpLAogICAgICAgICAgICAgICAgJ2NzcmZtaWRkbGV3YXJldG9rZW4nIDogJCgiaW5wdXRbbmFtZT1jc3JmbWlkZGxld2FyZXRva2VuXSIpLnZhbCgpCiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIHN1Y2Nlc3M6IHNlYXJjaFN1Y2Nlc3MsCiAgICAgICAgICAgIGRhdGFUeXBlOiAnaHRtbCcKICAgICAgICB9KTsKICAgICAgICAKICAgIH0pOwp9KTsKCmZ1bmN0aW9uIHNlYXJjaFN1Y2Nlc3MoZGF0YSwgdGV4dFN0YXR1cywganFYSFIpCnsKICAgICQoJyNzZWFyY2gtcmVzdWx0cycpLmh0bWwoZGF0YSk7Cn0=