Forums › Forums › Search & Filter Pro › How to get SF to work when the search page is loaded with ajax?
Tagged: ajax
- This topic has 5 replies, 2 voices, and was last updated 5 years, 1 month ago by Trevor.
-
Anonymous(Private) October 19, 2019 at 1:30 pm #224170
Hello,
I am unable to get SF to work when i ajax load a page. If i do a regular page load it all works, I obviously need to initialise something via js but unsure what.
The site is https://app.topline-music.com
If you load that page and click the magnifying glass (top left), wait for the page to load then type in something like “dark” nothing will happen and hitting search or return will do a page load. However if you load that page cold, and type “dark” into the box it will dim and load the results via the SF ajax functionality.
Any help much appreciated!
Matt
Trevor(Private) October 21, 2019 at 11:22 am #224217You would probably need to talk with the author of the Audio player software. If it is a popular one, other users may have posted a solution on these forums already, in which case a quick search might show those posts.
Our part of the needed code looks like this:
<script>(function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ console.log("ajax complete"); // call your function here }); }(jQuery));</script>
These were the threads that I could find:
https://support.searchandfilter.com/forums/topic/display-issue-3/
https://support.searchandfilter.com/forums/topic/problem-with-acf-meta-key-values/
https://support.searchandfilter.com/forums/topic/dynamic-result-url/ -
AuthorPosts