Setting up category page pagination and filtering javascript