-1

I'm using ajaxComplete to catch AJAX requests, the only problem is that I can't catch the /cart.js because there's always a random Query String.

ex- '/cart.js?_=1324346569'

How can I tell ajaxComplete to ignore query strings so my code picks up on just '/cart.js'?

My code is the following -

$(document).ajaxComplete(function(event, xhr, settings) {
    if (settings.url === "/cart.js") {
        console.log('caught cart.js even tho it has these query parameters');
    }
});

Thanks!

0

1 Answer 1

0
if (settings.url.includes("/cart.js")) {
  // ....
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.