Forums Forums Search & Filter Pro Getting JS to work with AJAX-loaded post results

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Anonymous
    #213593

    Nevermind. I figured it out on my own. For anyone else who might come across this problem, you can add a general event listener once the AJAX is completed using jQuery:

    $( document ).ajaxComplete(function( event, xhr, settings ) {
                        //Code goes here
                    });
    Trevor
    #213602

    Our own event listener looks like this (you may want to use this):

    <script>(function ( $ ) {
      "use strict";
      $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    // so load your script here again
      });
    }(jQuery));</script>
Viewing 2 posts - 1 through 2 (of 2 total)