From 44420c8ad7539ca8849fbcb6ea54c9e592d0d8e3 Mon Sep 17 00:00:00 2001 From: Junior Date: Tue, 12 Nov 2024 09:53:32 -0500 Subject: [PATCH] Only trigger content search if search field length > 2 --- js/books.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/books.js b/js/books.js index 62d6557..4e96af4 100644 --- a/js/books.js +++ b/js/books.js @@ -34,7 +34,7 @@ $(document).ready(function() { }); $("#search").on("change keyup", function() { if ( searchTimeout ) clearTimeout(searchTimeout); - searchTimeout = setTimeout(getContents, 500); + if ( $("#search").val().length > 2 ) searchTimeout = setTimeout(getContents, 500); }); });