Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
8510 Vizualizări

When inserting the Google Maps API, I get the following error:

Malformed XML document: This page contains the following errors:error on line 39 at column 43: Specification mandate value for attribute async Below is a rendering of the page up to the first error.


Any help? I removed async but still receive errors. I am assuming I need to insert the code elsewhere and refer to it. Below is the culprit:

<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"> </script>

Imagine profil
Abandonează
Autor Cel mai bun răspuns

I had to use a different method of adding the map.


<script src="http://maps.googleapis.com/maps/api/js?key=YOUR-KEY-HERE"></script>
<script> function initialize() { var location = new google.maps.LatLng(53.564869,9.926917); var mapProp = { center:location, zoom:14, mapTypeId:google.maps.MapTypeId.ROADMAP }; var map=new google.maps.Map(document.getElementById("googleMap"),mapProp); var marker = new google.maps.Marker({ position: location, map:map }); marker.setMap(map); }; google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div id="CSS-MAP-DIV" style="width:100%;height:500px;"></div>

Imagine profil
Abandonează
Cel mai bun răspuns

it need to be xml, so all attributes require a value...


<script async="async" defer="defer" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"> </script>
Imagine profil
Abandonează

Meanwhile, in v15 you can now just use 'head/footer code' (common on all page) or html block (on a specific page) to past this kind of script ;)

Related Posts Răspunsuri Vizualizări Activitate
6
nov. 17
11295
2
mar. 15
7430
3
aug. 24
13497
0
apr. 18
4104
1
ian. 24
1288