Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Google Maps Javascript stops working if Ajax Search is present
- This topic has 13 replies, 2 voices, and was last updated 8 years, 6 months ago by
Ernest Marcinko.
-
AuthorPosts
-
December 5, 2017 at 11:35 am #15721
otuxe
ParticipantHi!
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 #15722Ernest Marcinko
KeymasterHi!
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.
December 5, 2017 at 12:08 pm #15723otuxe
ParticipantThank 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 #15724Ernest Marcinko
KeymasterHi,
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.
December 5, 2017 at 12:42 pm #15725otuxe
ParticipantYou cannot access this content.
December 5, 2017 at 1:02 pm #15726Ernest Marcinko
KeymasterHi,
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!
December 5, 2017 at 2:14 pm #15729otuxe
ParticipantYou cannot access this content.
December 5, 2017 at 2:31 pm #15730Ernest Marcinko
KeymasterYou cannot access this content.
December 5, 2017 at 2:42 pm #15731otuxe
ParticipantYou cannot access this content.
December 5, 2017 at 2:52 pm #15732Ernest Marcinko
KeymasterYou cannot access this content.
December 5, 2017 at 2:57 pm #15733otuxe
ParticipantYou cannot access this content.
December 5, 2017 at 3:14 pm #15734Ernest Marcinko
KeymasterThanks, 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:
[html]checkedBoxes = ([…document.querySelectorAll(‘input[type=checkbox]:checked’)]).map(function(o) { return o.id; });[/html]
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:
[html]checkedBoxes = ([…document.querySelectorAll(‘#options input[type=checkbox]:checked’)]).map(function(o) { return o.id; });[/html]
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!
December 5, 2017 at 3:24 pm #15735otuxe
ParticipantYou cannot access this content.
December 5, 2017 at 3:27 pm #15736Ernest Marcinko
KeymasterI’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.
-
AuthorPosts
- You must be logged in to reply to this topic.