Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Google Maps Javascript stops working if Ajax Search is present
This topic contains 13 replies, has 2 voices, and was last updated by Ernest Marcinko 6 years, 9 months ago.
- AuthorPosts
- December 5, 2017 at 11:35 am #15721
Hi!
I have the following problem. When I add Ajax Search to the same website with Google Maps, all the markers on the google map will load up just fine. However, when I filter the markers, all of the markers will disappear.
I have tried debugging, nothing is wrong, there are no error messages. The whole page is hard-coded. When I replace Ajax Search shortcode with other shortcodes, the whole map will function as it should. The website will stop working regardless of the location or way the ajax search is called.
What could be the reason for this?
If you need any more information, please let me know.
Thank you!
December 5, 2017 at 11:48 am #15722Hi!
I have looked at the page source, at first sight I would say that one major issue is that the jQuery script is included 3 times.
The first one in the header is the correct one, as it’s enqueued by WordPress, but there are two more instances within the middle of the page (on line 375 and 379 on the main page source). I have copied that section here, see lines 1 and 5, both loading jQuery 2nd. and 3rd. times:I would suggest removing those first, and making sure that any custom script is enqueued properly.
This may not be the exact cause though, but it’s worth fixing first.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 5, 2017 at 12:08 pm #15723Thank you for the suggestion! I have removed those duplicate instances. Sadly, it does not solve the issue. Is there anything else I should try?
Thank you in advance!
December 5, 2017 at 12:23 pm #15724Hi,
Well, I’m not sure, but maybe changing these two options on the Compatibility Settings submenu: https://i.imgur.com/0QMWdPN.png
These are just wild guesses, it can be something completely different – like a syntax error somewhere, something with the integration or something similar. Can I somehow test the issue? If you can add temporary back-end and FTP details, and steps on how exactly I can replicate it, I may be able to solve it.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 5, 2017 at 12:42 pm #15725You cannot access this content.December 5, 2017 at 1:02 pm #15726Hi,
You are welcome 🙂
Can you please check the back-end log-in details? It says that the password is not correct for that username. Thank you!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 5, 2017 at 2:14 pm #15729You cannot access this content.December 5, 2017 at 2:31 pm #15730You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 5, 2017 at 2:42 pm #15731You cannot access this content.December 5, 2017 at 2:52 pm #15732You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 5, 2017 at 2:57 pm #15733You cannot access this content.December 5, 2017 at 3:14 pm #15734Thanks, this one works!
I may have found the problem, but I can’t open files via the FTP account you sent, so I could not test a solution.
Basically there is an error within a custom code on the page within the updateView() function declaration, on this line:
checkedBoxes = ([...document.querySelectorAll('input[type=checkbox]:checked')]).map(function(o) { return o.id; });
This line means, that it maps all the checkboxes found on the page, which also includes the checkboxes within the search form, or anything at all, even invisible ones.
My suggestion to fix that would be to make the query more specific, like so:
checkedBoxes = ([...document.querySelectorAll('#options input[type=checkbox]:checked')]).map(function(o) { return o.id; });
This will make sure that the selection only affects the checkboxes which are contained by the element with the ‘options’ ID.
I hope this helps!
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 5, 2017 at 3:24 pm #15735You cannot access this content.December 5, 2017 at 3:27 pm #15736I’m glad I was able to help you out 🙂
Actually, if you could rate the plug-in codecanyon downloads page, it would help me a lot.
Thank you again for your kind words! I will leave this topic open for a few days, then close it and mark it as resolved, if nothing comes up.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.