I implemented multiple flag filtering for the job portal using jQuery, where I called the function every time the flag was set, and this function contained an ajax call that would send a request with verified values, and I would make a database query and return the result.
But one of the developers I met told me that you should not constantly hit the database for filtering, this should be done on the client side.
He also suggested using AngularJS or Knockout (js) for this purpose, since they work on content, while jQuery works on DOM elements.
But if you need to do this on the client side, all the data should be downloaded immediately during the first visit to the page, which, in turn, will slow down the page.
And I cannot use a class for each element and show / hide them based on the identifier of the flag or mean something like this, because there are many flags that I think will be hectic.
How to achieve the desired result with good performance?
I'm new to jQuery, so if I didnβt do what I always did, carry me.
Below is an example that I really did:
HTML:
<input type="checkbox" name="location[]" value="Bangalore" onclick="loadresult()">Bangalore
JS:
function loadresult() { location array value accessed and passed to ajaxcall
PHP (processresult.php) :
<?php
source share