Upon a quick look: the search program queries
Thanks, so it's a completely different mechanism and implementation.
I am very impressed also because I am moving my first steps with JavaScript: everything is "new" for me
Note that, by deploying this, you’re banning various groups of people from using the search feature.
Why?
Which is the right way to implement such a feature?
- - -
In my case, at the moment I have less than 100 items, so my JS trick doesn't make the HTML page too fat and it does the job, but imagine you have 10000 items to index for query, with my JS trick, I would have to put ~10.000 items hidden into the HTML body (does it suck?).
I'm also impressed with the quick responsiveness of the search engine, as it reacts immediately as you type.
I mean, I am more used to the old-school "fill an input box" with a keywork and press the "submit" button
<form action="app1_react.html" method="post">
<input type="text" id="search" name="search" value="keyword"><br>
<input type="submit" value="Submit">
</form>
Which issues a "POST" (or a "PUT") request to the HTTP server, which elaborates it, and replies with the answer (app1_react.html).
POST /app1_react.html HTTP/1.1
Host: 192.168.1.81:1081
User-Agent: Mozilla/5.0 Firefox/121.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 55
Origin: http://192.168.1.81:1081
Connection: keep-alive
Referer: http://192.168.1.81:1081/app1.html
Upgrade-Insecure-Requests: 1
search=keyword