I am trying to load Google Maps in my Javascript, but I keep getting the error ‘document.body is null’. Can anybody help?
<html>
<head>
</head>
<body>
<div></div>
</body>
</html>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="https://www.google.com/jsapi?key=gfgfgfgfgfg"></script>
<script type="text/javascript">
$(document).ready(function () {
google.load('maps','3', {other_params: "sensor=false&callback=mapsLoaded&key=gfgfgfgfgf"});
});
function mapsLoaded()
{
alert("done");
}
</script>
To get information of a certain position, and not drawing a map it is better to use Google’s geocoding services:
For more details on other params please take a look at the API:
http://code.google.com/apis/maps/documentation/javascript/geocoding.html#GeocodingRequests
Hope it helps.