ajax problem filtering

Forums › Forums › Search & Filter Pro › ajax problem filtering

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

    Hello
    https://www.gorilla-glue.com/gorilla-products

    i get this error in console, the ajax doesn t filter the results

    QMIGRATE: Migrate is installed, version 1.4.1 jquery-migrate.min.js:2:542
    Custom Theme JS Code: TypeError: “$ is not a function”
    <anonymous> http://www.gorilla-glue.com/gorilla-products/:75
    gorilla-products:99:16
    <anonymous> http://www.gorilla-glue.com/gorilla-products/:99
    Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.gorilla-glue.com/?sfid=232&sf_action=get_data&sf_data=results&_sft_category=gorilla-glues&lang=en. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).[Learn More]

    Anonymous
    #210372

    https://www.gorilla-glue.com/gorilla-products/

    problem was the link to the results page, i had to use https:// instead of http://

    now ajax works but in my console i still get this error

    JQMIGRATE: Migrate is installed, version 1.4.1 jquery-migrate.min.js:2:542
    Custom Theme JS Code: TypeError: “$ is not a function”
    <anonymous> https://www.gorilla-glue.com/gorilla-products/:88
    gorilla-products:112:16

    Trevor
    #210416

    It is this code you have loading inline on the page:

    https://www.screencast.com/t/o8QIxXIa

    It isn’t actually doing anything at this time, so should not be needed, but is incorrectly written anyway.

    I think it should look like this:

    try { //detects the start of an ajax request being made
      (function ( $ ) {
        "use strict";
        $(document).on("sf:ajaxstart", ".searchandfilter", function(){
          console.log("ajax start");
        });
    
    //detects when the ajax request has finished and the content has been updated
    // - add scripts that apply to your results here
        $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
    	  console.log("ajax complete");
    	//so load your lightbox or JS scripts here again
        });
    
    //an event fired when S&F is initialised and S&F scripts have been loaded
        $(document).on("sf:init", ".searchandfilter", function(){
    	  console.log("S&F JS initialised");
        });
    
    //depending on where you add your JS, sometimes its necessary to wrap the above events in a function (as is standard practice):
        $(document).on("sf:init", ".searchandfilter", function(){
    	  console.log("S&F JS initialised");
        });
      }(jQuery));
     } catch (e) { console.error('Custom Theme JS Code: ', e); }
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.