Hacker News new | ask | show | jobs
by etattva 2793 days ago
How do I allow filtering to be done on client side? I am comparing with cargurs, aamozn wayfair, how to get that filter option on left and still keep content. I was think load content first and then load filter on left. This is what amazon does
2 comments

Use javascript. Display all the data at the first load. Then make make ajax calls with the filter data to the server, filter and process the results there and replace the original content on the client side with innerHTML().
On a small side project, I load the initial results with the template and then do filtering and additional searching with js. This allows me to be SEO friendly, while still having nice filtering functionality.