|
|
@ -19,7 +19,7 @@ $(document).ready(function() { |
|
|
|
{ |
|
|
|
{ |
|
|
|
var url = input.data("url"); |
|
|
|
var url = input.data("url"); |
|
|
|
var search = input.val(); |
|
|
|
var search = input.val(); |
|
|
|
window.location.href = url + '?search=' + search; |
|
|
|
window.location.href = url + '?search=' + encodeURIComponent(search); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$("#js-blog-search").keydown(function(e) { |
|
|
|
$("#js-blog-search").keydown(function(e) { |
|
|
@ -37,7 +37,7 @@ $(document).ready(function() { |
|
|
|
var url = $(this).data("url"); |
|
|
|
var url = $(this).data("url"); |
|
|
|
var search = $(this).val(); |
|
|
|
var search = $(this).val(); |
|
|
|
if (search.length == 0 || search.length >= 3) { |
|
|
|
if (search.length == 0 || search.length >= 3) { |
|
|
|
fetch(url + '/search?query=' + search) |
|
|
|
fetch(url + '/search?query=' + encodeURIComponent(search)) |
|
|
|
.then(response => response.text()) |
|
|
|
.then(response => response.text()) |
|
|
|
.then(data => { |
|
|
|
.then(data => { |
|
|
|
$("#blog-posts").empty().append(data); |
|
|
|
$("#blog-posts").empty().append(data); |
|
|
|