Forums › Forums › Search & Filter Pro › Search issue Geodirectory.
- This topic has 7 replies, 2 voices, and was last updated 6 years, 7 months ago by
Anonymous.
-
Anonymous(Private) July 18, 2018 at 12:26 pm #182821
So, I have had this working pretty good, but have found this weird bug.
You can go here…
https://dev.greatsmokies.com/cabins/
Any submit causes an email address to pop up on a blank page. Looks like it is Ajax and Geodirectory’s email script?
document.write('<a href="mailto:'+'fryemont' + '@' + 'dnet.net'+'">fryemont@dnet.net</a>')
Ajax off works fine. But, we need to have instant load on these.
Example of OFF
https://dev.greatsmokies.com/bb/
Thoughts?
Anonymous(Private) July 18, 2018 at 1:47 pm #182839Since I have to use Geodirectory’s templating to get the specific layouts to work (social, web/email), I have not tried. (Using the standard results.php only loads the basic text).
But, this only happened after I added the email field. When the Email field is disabled, the Ajax loading works. (I have it disabled right now).
I have already run a log file, and cannot trigger any errors.
This is the closest clue I have, which may put this in Geo’s territory,
“You can’t use document.write once the document has completed loading. If you do, the browser will open a new document that replaces the current.”
I suspect Geo will not support this issue, since they have their own search tool they sell as part of their program. And it is AWFUL (this tool rules, by far)…
This is a major project, as you may imagine (THE Great Smokies..). So, hopefully we can find a solution.
Thank you
Anonymous(Private) July 18, 2018 at 2:25 pm #182853Well, more disappointment.
I decided to turn off the Ajax on a couple of searches. I have found another bug that was rearing it’s head is gone now. Sometimes my images would not open via Fancybox. Sometimes they were also white boxes, with no image there (but clickable, opening in a new window).
It seems the Ajax is breaking that tool as well.
Ughh…
Trevor(Private) July 18, 2018 at 2:32 pm #182855When Ajax runs from any script, it refreshes the target container. If THAT container ALSO contain items whose content is built with a script (or to which a script is run to place a listener event for example), then those scripts must be re-run. This is the case whenever this series of events happens, with our plugin or any other plugin that refreshes content using Ajax. We provide methods to trigger your scripts on certain Ajax events, one of which is when the Ajax refresh of the results happens. The script would look like this:
<script>(function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ console.log("ajax complete"); // call your functions here }); }(jQuery));</script>
Anonymous(Private) July 18, 2018 at 10:14 pm #182927I am happy to report that I was able to solve the emails breaking AJAX issue.
Now, the only problem I see is that after AJAX, the images for the entries are being stripped of a class. I have found this comment by the dev of the Fancybox addon for WordPress..
But, I don’t want to go wandering in your code. Any thoughts on how to implement the fix?
Thank you
Trevor(Private) July 19, 2018 at 5:17 pm #182972You would need to add a script like this to the page:
<script>(function ( $ ) { "use strict"; $(document).on("sf:ajaxfinish", ".searchandfilter", function(){ console.log("ajax complete"); jQuery(document.body).trigger('post-load'); }); }(jQuery));</script>
Anonymous(Private) July 19, 2018 at 5:52 pm #182983Thank you. I tried this yesterday and did not have any luck. No errors either…
But, somewhere I went wrong. Copy pasted and it worked like a charm.
Appreciate the great support and love the plugin. This is a big win, as I have another site ready to go with the same system!
Cheers (and may close)
-
AuthorPosts