Detect Ajax call

Forums › Forums › Search & Filter Pro › Detect Ajax call

Tagged: 

Viewing 3 posts – 1 through 3 (of 3 total)
  • Anonymous
    #139640

    Hey,

    We’re integrating Photoswipe with Search/Filter Pro. However Photoswipe only knows about the elements in the DOM on page load and does not know when new items get added (through ajax). Is there a hook we could use to tell Photoswipe to rebuild its index when Search/Filter Pro has an successful ajax request?

    Thanks, Adam

    Trevor
    #139641

    Indeed there is. Replace the comment in this code with whatever Photoswipe needs to do:

    <script>(function ( $ ) {
      "use strict";
      $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
        console.log("ajax complete");
    // load your Photoswipe javascript here
      });
    }(jQuery));</script>
    Anonymous
    #139643

    Thanks, Will try this!

Viewing 3 posts – 1 through 3 (of 3 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.