Answer the question
In order to leave comments, you need to log in
Filtering products in js without reloading the page?
How to filter products by category without reloading the javascript page? For example, there are sections "computers", "vacuum cleaners", "irons", and by clicking on a category, only products that are in this section should be shown, while others should be hidden
Answer the question
In order to leave comments, you need to log in
1. If you need to filter only what came to the page, you can take filtering by class and show only those where classList.contain.
1.2 Or hang up the date parameters.
1.3 Either load them immediately in JS and draw them with JS.
1.4 And it's even better to drive into a module which one from a JS framework that has reactivity.
And if you receive data from the API, then the same approach, only modified by requests to the service, for example.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question