I want to show a map with some locations for this I use the library gmaps js link
And everything works fine on my computer, but when I upload it to my server it sends me the following error
common.js: 48 Uncaught TypeError: Can not read property 'prototype' of undefined
If I upload my code to the jsfiddle if it works well. I do not know why on my server he sent me that error. I tried a free hosting and the map is also seen correctly
This is the example of my code link
Thank you to whoever responded, but the problem is not that. Here is another test I did
<!DOCTYPE html> <!-- archivo completo -->
<html>
<head>
<title></title>
<style type="text/css">
html,
body,
#maps {
display: block;
width: 100%;
height: 100%;
}
#maps {
background: #58B;
}
</style>
<script type="text/javascript" src="assets/plugins/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js"></script>
<script type="text/javascript" src="assets/plugins/gmaps/gmaps.js"></script>
<script type="text/javascript">
$(document).ready(function() {
map = new GMaps({
div: '#maps',
lat: 38.542982,
lng: -90.16917,
scrollwheel: false,
zoom: 11
});
map.addMarker({
lat: 38.5778969,
lng: -89.9878952,
verticalAlign: 'top',
title: 'Ceremony Location',
infoWindow: {
content: '<div class="note">Ceremony</div><h4 class="map-title script">Grace Church</h4><div class="address"><span class="region">5151 N Illinois St</span><br><span class="postal-code">Fairview Heights IL</span><br><span class="city-name">62208</span></div>'
}
});
map.addMarker({
lat: 38.5083615,
lng: -90.2969051,
title: 'Reception Location',
infoWindow: {
content: '<div class="note">Reception</div><h4 class="map-title script">Royals Orleans</h4><div class="address"><span class="region">2801 Telegraph Rd</span><br><span class="postal-code">Saint Louis, MO</span><br><span class="city-name">63125</span></div>'
}
});
});
</script>
</head>
<body>
<div id="maps" class="map-container">
</body>
</html>
This file works perfectly on my computer.
If I upload it to my server server link It does not work. This error appears:
And in the console it shows
Uncaught TypeError: Cannot read property 'prototype' of undefined
common.js:48
Google Maps API warning: NoApiKeys
https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
util.js:211
As you can see, if you do not have the KEY API, it's just a warning, try to upload it with the KEY API and it does not work either.
The weird thing is that the error sends it in a Javascript called common.js
that I do not have imported, as if it were loaded dynamically from somewhere.
This is the debug of my team, as you can see the file is local
and this is the production server
Since javascript is minimized, it is impossible to know what it does.
They could help me.