@emilyvansomeren Could you please tell us how you fixed it? We’re facing the same problem here. We have a Javascript error like this:
Uncaught (in promise) SyntaxError: Expected property name or '}' in JSON at position 1 (line 1 column 2)
at Function.parse as parseJSON
at em_maps_load_locations (maps.js:41:23)
at HTMLDivElement. (maps.js:136:60)
at Function.each (jquery-3.4.1.min.js?ver=3.4.1:2:2777)
at k.fn.init.each (jquery-3.4.1.min.js?ver=3.4.1:2:1419)
at em_maps (maps.js:136:33)
at js?v=quarterly&libraries=places&callback=em_maps&key=AIzaSyA_y7NmQY28SH0ldRcTe6NdZGgjLyTwee8:288:509
at js?v=quarterly&libraries=places&callback=em_maps&key=AIzaSyA_y7NmQY28SH0ldRcTe6NdZGgjLyTwee8:288:21
It’s a error that occurs on this piece of code:
function em_maps_load_locations(el){
var el = jQuery(el);
var map_id = el.attr('id').replace('em-locations-map-','');
var em_data = jQuery.parseJSON( el.nextAll('.em-locations-map-coords').first().text() );
if( em_data == null ){
var em_data = jQuery.parseJSON( jQuery('#em-locations-map-coords-'+map_id).text() );
}
The JSON looks like this:
{“em_ajax”:true,”query”:”GlobalEventsMapData”,”width”:”400px”,”height”:”300px”,”id”:486052607}
However in my html it parses html entities:
<div class='em-locations-map-coords' id='em-locations-map-coords-1667966170' style="display:none; visibility:hidden;">{“em_ajax”:true,”query”:”GlobalEventsMapData”,”width”:”400px”,”height”:”300px”,”id”:1667966170}</div>
Like this:
<div class=’em-locations-map-coords’ id=’em-locations-map-coords-1667966170′ style=”display:none; visibility:hidden;”>{“em_ajax”:true,”query”:”GlobalEventsMapData”,”width”:”400px”,”height”:”300px”,”id”:1667966170}</div>
It seems the quotes are not the correct opening and closing quotes?
-
This reply was modified 11 months, 2 weeks ago by
rienco.