Forums Forums Search & Filter Pro Split: Hide Search Results on Page Load

Viewing 8 posts - 11 through 18 (of 18 total)
  • Anonymous
    #50302

    Addendum:

    – The “hideSearchResults.js” function and file should really be called “showSearchResults”… my mistake…
    – The error thrown is “Can’t find variable: JQuery”.

    adam

    Anonymous
    #50303

    Well, after all that, would you believe that when I renamed the file / function, as per my last addendum, the error went away, and the wrapping JQuery statement displays correctly when viewed in my web inspector!

    However, the main problem remains: the search results never show up.

    Le sigh.

    Oh, I meant to mention that I changed the code to specifically reference the exact CSS selector I used to initially hide the search results in my stylesheet. Because using Trevor’s suggested JQuery (in post #3 above) didn’t work… but either way, no search results.

    I’ve done as much banging away on this as I can for tonight… I await your wisdom. Thanks!

    Anonymous
    #50456
    This reply has been marked as private.
    Anonymous
    #50614

    HI again! So sorry, my client, bless his heart, changed the URL again of the page without telling me. Ah well. The URL is now:

    http://escape2ski.com/find-an-airport-close-to-ski-resorts/

    However, the problem persists.

    In trying to troubleshoot this, I’ve changed the JQuery to be:

    jQuery(document).ready(function($) {
    
    $('#search-filter-results-8513').on('sf:ajaxfinish',function(e, x){
       $('#search-filter-results-8513').show();
       $('#search-filter-results-8513').css({"background-color":"red"});
       console.log(e);
       console.log(x);
    });
    
    });
    

    AND removed the initial hiding from the CSS file.

    I just want to see if the script can make ANY changes on the page. But the search results do not acquire a red background.

    I’ve confirmed that the script is indeed loading, it’s the latest version (being GoDaddy WP hosting, I have to clear their cache first)… but nothing is happening. Kind of at a loss as to how to troubleshoot it, but I do hope you can help.

    adam

    Anonymous
    #50840

    Hi again guys. Just to summarize my efforts so far:

    – Checked for errors in the console log in my browser’s inspector (no errors)
    – Realized I hadn’t set the search form to use Ajax! I fixed that, and had high hopes that this was the solution, but… still no reaction to my script.
    – Tried loading the script in the footer, not the header, in case it was loading too early. Still no joy.

    I realize this is closer to a developer-side issue than a user-support one, but I feel like I’m so very close, or that it’s something I’m just never going to be able to track down without your knowledgable eye. I notice that there’s been no followup at your end but I hope you can devote just a bit more time to this, as it’s a big issue for my client and I feel, rightly or wrongly, that I’ve run out of things to try.

    Let me know. Thanks.

    Anonymous
    #50842

    Addendum: since I’d like the results to be visible to my client while I sort this out, I’ve removed the CSS that hides them, and am adding a line to get the jQuery script to do something else noticeable:

    jQuery(document).ready(function($) {
    
    $('#search-filter-results-8513').on('sf:ajaxfinish',function(e, x){
       $('#search-filter-results-8513').show();
       $('#search-filter-results-8513').css({"background-color":"red"});
       console.log(e);
       console.log(x);
    });
    
    });
    Anonymous
    #50985

    It’s solved! Turns out that if I followed the structure given in your FAQ, with a little customization of course… it worked.

    What seems to have sent me off track was that the code provided in post #3 above, with the ‘(e, x)’ in it, differed quite a bit from the structure in the FAQ, but I stuck with it. Should have really read the FAQ I guess!

    Still unclear on what the purpose of the “(e,x)” stuff is, but I guess for the moment anyway I don’t need to know. Would be good to know how that got into the mix as a suggestion though…. since it does differ from the FAQ… but my bad for not at least trying that FAQ version out.

    Thanks!
    adam

    Trevor
    #51005

    What was the final solution? The e and x are the minified jQuery variable names.

Viewing 8 posts - 11 through 18 (of 18 total)