Hi. I'll try use jQuery for realize live search on this module. But it doesn't work.
I took these code:
$(document).ready(function() {
var $result = $('#se-results');
$('#se-form').on('keyup', function(){
var q = $(this).val();
if ((q != '') && (q.length > 1)){
$.ajax({
type: "POST",
url: "./",
data: {'q': q},
success: function(msg){
$result.html(msg);
if(msg != ''){
$result.fadeIn();
} else {
$result.fadeOut(100);
}
}
});
} else {
$result.html('');
$result.fadeOut(100);
}
});
$(document).on('click', function(e){
if (!$(e.target).closest('.search-form').length){
$result.html('');
$result.fadeOut(100);
}
});
});
What i do wrong? Maybe i use not supported method?