The HTML and JavaScript on your test site is very different from the code you listed. The script tags are in a different order, and there are spaces in the Maps API script URL.
If you use the actual code you listed in your message it should work. But more important than that is to learn how to debug JavaScript code so it won't be a mystery. Open the JavaScript console and look at the errors it shows. If you're not familiar with the browser developer tools, it's time to learn them. For Chrome, start here <https://developer.chrome.com/devtools>. Every browser has similar tools. -Mike On Mon, Jul 18, 2016 at 2:53 AM, <suean...@caramail.com> wrote: > Hi I just tried out google maps on my website > http://www.frenchhouse.website/gmap.html > But it wont work. > This is the simple map sample with my api. > <html> > <head> > <style> > #map { > width: 100%; > height: 400px; > } > </style> > </head> > <body> > <h3>My Google Maps Demo</h3> > <div id="map"></div> > <script> > function initMap() { > var mapDiv = document.getElementById('map'); > var map = new google.maps.Map(mapDiv, { > center: {lat: 44.540, lng: -78.546}, > zoom: 8 > }); > } > </script> > <script async defer src="https://maps.googleapis.com/maps/api/js?key= > AIzaSyAwRsfs4UeGT5iBr7yvffQ3SAcO6tLuBjk&callback=initMap"> > </script> > </body> > </html> > Any help welcome thanks > > -- > You received this message because you are subscribed to the Google Groups > "Google Maps JavaScript API v3" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to google-maps-js-api-v3+unsubscr...@googlegroups.com. > To post to this group, send email to > google-maps-js-api-v3@googlegroups.com. > Visit this group at https://groups.google.com/group/google-maps-js-api-v3. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-maps-js-api-v3+unsubscr...@googlegroups.com. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. Visit this group at https://groups.google.com/group/google-maps-js-api-v3. For more options, visit https://groups.google.com/d/optout.