Skip to content

Commit

Permalink
Update searchBar.js
Browse files Browse the repository at this point in the history
  • Loading branch information
DogukanUrker committed Jan 17, 2024
1 parent cea0e2d commit 94df3ba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions static/tailwindUI/js/searchBar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
function searchBar() {
var input = document.querySelector("#searchBarInput").value;
console.log(input);
if (input === "" || input.replace(/\s/g, "") === "") {
const input = document.querySelector("#searchBarInput").value;
if (input === "" || input.trim() === "") {
} else {
window.location.href = `/search/${input.replace(/\s/g, "+")}`;
window.location.href = `/search/${encodeURIComponent(
escape(input.trim())
)}`;
}
}

0 comments on commit 94df3ba

Please sign in to comment.