title: Loading google maps asynchronously
body: <p>I am trying to load my google map asynchronously and it works but it is loading the map in twice. If I remove "<code>box.onload = initialize;</code>" this stops that problem but then the infobox doesn't show...how do I fix my code so it only loads the map once AND shows the infobox.</p>
  
  <pre><code>function loadScript() {
     var map = document.createElement('script');
     map.type = 'text/javascript';
     map.src = 'https://maps.googleapis.com/maps/api/js?key=key_goes_here&amp;sensor=false&amp;callback=initialize';
     document.body.appendChild(map);  
  
     map.onload = function() {
        var box = document.createElement('script');
        box.type = 'text/javascript';
        box.src = 'https://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox_packed.js';
        document.body.appendChild(box);
        box.onload = initialize;
     };
  }           
  window.onload = loadScript;
  </code></pre>