I have 3 websites with this google maps code which is working fine:
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script>
function initialize() {
var myLatlng = new google.maps.LatLng(38.7223956, -9.1358012);
var mapOptions = {
zoom: 16,
center: myLatlng
}
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Something'
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<style>
h1 { background:none; padding:0; }
#map-canvas {
width:100%;
height:250px;
}
</style>
<div id="map-canvas"></div>
It's working great also if I'm just putting it on an html file on my hard drive. Recently, I started a Wordpress project on my localhost and I don't know why but when I'm adding this code to my project I get this:
Obviously I have already wordpress websites that working with the same exact code, I have no idea why suddenly I'm getting this message, It's unbelievable