-
AuthorPosts
-
October 22, 2016 at 12:15 pm #702800
Hello,
When pressing the “Click here to enter an address.” button I get the following error in my javascript console:
ReferenceError: event is not defined: event.preventDefault();
Located in:
themes/enfold/framework/js/conditional_load/avia_google_maps_widget.js?ver=1.0.0
Line 39
The expected action does not happen (pop up to enter the address doesn’t show, nothing happens)
The error comes from these lines:
$(".avia-coordinates-help-link").on('click', function() { event.preventDefault(); avia_google_maps_widget_container = jQuery(this).parents('.widget-content'); avia_google_maps_widget_container.find(".avia-coordinates-help-link").hide(); avia_google_maps_widget_container.find(".avia-coordinates-wrapper").hide(); avia_google_maps_widget_container.find(".avia-find-coordinates-wrapper").show(); }); $(".avia-populate-coordinates").click(function() { event.preventDefault(); avia_google_maps_widget_container = jQuery(this).parents('.widget-content'); var streetAddress = avia_google_maps_widget_container.find(".avia-map-street-address").val(), city = avia_google_maps_widget_container.find(".avia-map-city").val(), state = avia_google_maps_widget_container.find(".avia-map-state").val(), postcode = avia_google_maps_widget_container.find(".avia-map-postcode").val(), country = avia_google_maps_widget_container.find(".avia-map-country").val(); avia_google_maps_widget_container.find(".avia-loading-coordinates").show(); var addressGeo = streetAddress + " " + city + " " + state + " " + postcode + " " + country; avia_fetch_coordinates(addressGeo); });
As far as I can see, it can be fixed by using event as parameter in the anonymous functions like so:
$(".avia-coordinates-help-link").on('click', function(event) { event.preventDefault(); avia_google_maps_widget_container = jQuery(this).parents('.widget-content'); avia_google_maps_widget_container.find(".avia-coordinates-help-link").hide(); avia_google_maps_widget_container.find(".avia-coordinates-wrapper").hide(); avia_google_maps_widget_container.find(".avia-find-coordinates-wrapper").show(); }); $(".avia-populate-coordinates"ck(function(event) { event.preventDefault(); avia_google_maps_widget_container = jQuery(this).parents('.widget-content'); var streetAddress = avia_google_maps_widget_container.find(".avia-map-street-address").val(), city = avia_google_maps_widget_container.find(".avia-map-city").val(), state = avia_google_maps_widget_container.find(".avia-map-state").val(), postcode = avia_google_maps_widget_container.find(".avia-map-postcode").val(), country = avia_google_maps_widget_container.find(".avia-map-country").val(); avia_google_maps_widget_container.find(".avia-loading-coordinates").show(); var addressGeo = streetAddress + " " + city + " " + state + " " + postcode + " " + country; avia_fetch_coordinates(addressGeo); });
- This topic was modified 7 years, 7 months ago by sander_eyedetail.
October 24, 2016 at 11:41 am #703205Any update on this?
October 25, 2016 at 7:12 am #703603Hi,
Thank you for using Enfold.
Is this happening in the advance layout builder? We need the login details to check the issue. Please post it in the private content field. Did you add the google map api key? http://kriesi.at/documentation/enfold/how-to-register-a-google-maps-api-key/
Best regards,
IsmaelOctober 25, 2016 at 10:02 am #703690I have the Enfold construction setup
It’s happening in the widget Enfold Child Google Maps Widget: Route that’s by default placed in the Sidebar Pages.Page where the error occurs: http://scode.nl/edsklussenbedrijf/wp-admin/widgets.php
Widget: Enfold Child Google Maps Widget: RouteOctober 28, 2016 at 10:39 am #705229Sorry to bump again, but is there an update?
October 28, 2016 at 11:12 am #705236Hi,
I’m sorry but I can’t see the error in the widgets panel. However, the following notification is in the console.
util.js:221 Google Maps API warning: InvalidKey https://developers.google.com/maps/documentation/javascript/error-messages#invalid-key
Please review the google maps api key documention. It’s possible that the API key that you entered in the Enfold > Google Services panel is incorrect. http://kriesi.at/documentation/enfold/how-to-register-a-google-maps-api-key
Best regards,
IsmaelOctober 28, 2016 at 11:20 am #705238I had a Google Maps warning, and I updated the api key. The google maps warning is now gone.
However, this did not fix the problem. I still cannot change the address in the widget.
See the attached image:
October 28, 2016 at 11:23 am #705241I’m quite certain the code change suggestion in my initial post would fix this problem. The JS error says event is not defined, and this is indeed the case. adding the event parameter to the anonymous functions would fix this.
Error is presenting on Firefox 49.0.2
- This reply was modified 7 years, 6 months ago by sander_eyedetail.
November 1, 2016 at 9:18 am #706618Hi,
I checked for the issue and was able to enter the address without any issues. There are no js errors in console showing on my end in windows chrome and firefox (screenshot attached).
For testing purpose just enter the state and country and fetch co-ordinates and save the changes. This should work for you as well. Then you can add just the street address.
Before trying the above steps please try to hard refresh by pressing Ctrl + Shift + F5 on your browser or press the F12 key to open chrome dev tools and right click on the refresh button and select “Empty Cache and Hard Reload” and review the site again.
Best regards,
Vinay -
AuthorPosts
- You must be logged in to reply to this topic.