Forums › Forums › Search & Filter Pro › Split: Hide Search Results on Page Load
- This topic has 17 replies, 3 voices, and was last updated 8 years, 4 months ago by Trevor.
-
Anonymous(Private) July 6, 2016 at 7:19 am #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(Private) July 8, 2016 at 9:53 pm #50614HI 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(Private) July 12, 2016 at 1:20 am #50840Hi 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(Private) July 12, 2016 at 1:23 am #50842Addendum: 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(Private) July 12, 2016 at 9:26 pm #50985It’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 -
AuthorPosts