html - Google Maps API Example not working, giving me blank screen -
the google maps api tutorial (https://developers.google.com/maps/tutorials/fundamentals/adding-a-google-map) giving me blank screen. have been working on 3 hours , cannot figure out.
i copied/pasted code exactly, saved .html file.
<!doctype html> <html> <head> <style> #map_canvas{ height: 500px; width: 400px; } </style> <script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> <script> function initialize() { var map_canvas = document.getelementbyid('map_canvas'); var map_options = { center: new google.maps.latlng(44.5403, -78.5463), zoom: 8, maptypeid: google.maps.maptypeid.roadmap } var map = new google.maps.map(map_canvas, map_options) } google.maps.event.adddomlistener(window, ‘load’, initialize); </script> </head> <body> <div id="map_canvas"></div> </body> </html>
you have illegal characters in code:
timestamp: 08/12/2013 02:08:39 pm error: illegal character line: 21, column: 48 source code: google.maps.event.adddomlistener(window, $(b!f(bload$(b!g(b, initialize);
change:
google.maps.event.adddomlistener(window, ‘load’, initialize);
to:
google.maps.event.adddomlistener(window, "load", initialize);
Comments
Post a Comment