Controllers+JS: Search in blog contents, fix special character search
This commit is contained in:
+2
-2
@@ -19,7 +19,7 @@ $(document).ready(function() {
|
||||
{
|
||||
var url = input.data("url");
|
||||
var search = input.val();
|
||||
window.location.href = url + '?search=' + search;
|
||||
window.location.href = url + '?search=' + encodeURIComponent(search);
|
||||
}
|
||||
|
||||
$("#js-blog-search").keydown(function(e) {
|
||||
@@ -37,7 +37,7 @@ $(document).ready(function() {
|
||||
var url = $(this).data("url");
|
||||
var search = $(this).val();
|
||||
if (search.length == 0 || search.length >= 3) {
|
||||
fetch(url + '/search?query=' + search)
|
||||
fetch(url + '/search?query=' + encodeURIComponent(search))
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
$("#blog-posts").empty().append(data);
|
||||
|
||||
Reference in New Issue
Block a user