Using infinite scroll ajax load more with search parameter

I have a infinite scroll working on my wordpress site. It works perfectly well on category pages, e.g.

example.com/example

however it doesnt work when I try to use it on a search page, e.g.

example.com/example//?search=truegender=female

I know I need to pass more parameters to the AJAX call, I'm just not sure how. The shortcode is like so..

do_shortcode('[talent taxonomy="'.$_GET['params']['taxonomy'].'" term="'.$_GET['params']['term'].'" page="'.$_GET['params']['page'].'" per_page="'.$_GET['params']['per_page'].'"]');

And the AJAX:

                var ajax_data = { 
                page:1,
                taxonomy:"'.$a['taxonomy'].'",
                term:"'.$a['term'].'",
                per_page:"'.$a['per_page'].'",
                max_pages: '.$my_query-max_num_pages.'
            };

Topic infinite-scroll ajax Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.