I am using Google Maps API to display a map on a certain page.
Problem is that the file http://maps.google.com/maps?file=api.....
sometimes happens to load
This is a rather old question now - the solution was to disable firebug (atleast for me).
On JavaScript optimization: always put your JS at the bottom of your even your Maps API script. I can't really think of any good reason to have any JS in the head.
Use Google's Ajax APIs. From some time past, all of Google's services can be accessed through the JavaScript API. It's a modular system, you only have to include the JSAPI library, and then you can dynamically load the modules you need—it won't block your site.
<script type="text/javascript"
src="http://www.google.com/jsapi?key=ABCDEFG"></script>
<script type="text/javascript">
google.load("maps", "2");
google.setOnLoadCallback(function() {
// Your logic goes here.
// It will be run right after the maps module was loaded.
});
</script>
For further details, see JSAPI's developer documentation.