How can I run two AJAX requests simultaneously in WordPress?

Eureka! So I ended up just adding in a second ajax call into the function. For some reason it’s returning successful but not with a 200 response. Anyway, it’s working. If anyone knows why it’s returning an unknown response (besides 200 or 201) please share. Thanks! function get_posts($params) { $.ajax({ url: psc.ajax_url, data: { action: … Read more

How to add Ajax to this Pagination i made?

To do this, you just need to make one ajax request in javascript. Here is a step-by-step solution. Add click handler in javascript When click send ajax request to pagination page Replace an element with “.blog-items” selector on current page from a new page jQuery(document.body).on(‘click’, ‘#pagination a’, function (event) { var linkElement = jQuery(event.currentTarget); jQuery.ajax(linkElement.attr(‘href’)).done(function … Read more