Forums › Forums › Search & Filter Pro › ajaxformfinish wont run my code
Tagged: ajax
- This topic has 18 replies, 2 voices, and was last updated 4 years, 11 months ago by Trevor.
-
Anonymous(Private) November 25, 2019 at 2:39 pm #227524
Good day,
i try to run a jquery code after the ajax run completed but it wont trigger for me.
We searched the forum for some solutions but teh onces geven wont work.Our page is:
http://ftdev.nl/syntrus-new/huuraanbod/we used the following code in the jquery and the plugin is last version.
$(document).on(“sf:ajaxformfinish”, “.searchandfilter”, function(){
console.log(“ajax complete”);
// your code
});Hope u can help me with this.
WilcoAnonymous(Private) November 25, 2019 at 4:01 pm #227556I have tryed both.
whne i update the filter (change status) i see the following message in my console but not the log.jquery-2.2.4.min.js:4 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check https://xhr.spec.whatwg.org/.
I want to trigger some jquery after the filter is changed.
Trevor(Private) November 25, 2019 at 4:04 pm #227560That error message is from jQuery 2.2.4, but WordPress, and our plugin, use 1.12.4. Using other version of jQuery can cause compatibility issues and is not recommended, as jQuery 1.x, 2.x and 3.x are not interoperable. Can you identify why jQuery 2.2.4 is being loaded to your site?
Trevor(Private) November 25, 2019 at 4:35 pm #227573You still see this error message?
jquery-2.2.4.min.js:4 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check https://xhr.spec.whatwg.org/.
Are you able to send me a live link/URL to your search page so I can take a look?
Anonymous(Private) November 26, 2019 at 7:50 am #227642the error is now:
jquery-1.12.4.min.js:4 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
This is the link to the search page. on top u see the filter if you click on “lijstweergave” u see the result.
http://ftdev.nl/syntrus-new/huuraanbod/Trevor(Private) November 27, 2019 at 3:35 pm #227795The issue in that warning message will not stop the filter from working.
Can I see the actual code you used, as the code you first showed me will not actually do anything, it is simply an empty container in to which to put your own code?
Is it being loaded inside an external file? If so, which one?
Anonymous(Private) November 27, 2019 at 3:56 pm #227800this is what i use to test it.
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){ console.log("ajax finish"); // your code }); $(document).on("sf:ajaxformfinish", ".searchandfilter", function(){ console.log("ajax complete"); // your code });
Both are in my script.js file
-
AuthorPosts