title: jquery get maps.google.com only when document ready
body: <p>Inside <code>&lt;head&gt;&lt;/head&gt;</code> placed <code>&lt;script src="http://maps.google.com/maps/api/js?sensor=true"&gt;&lt;/script&gt;</code></p>
  
  <p>Sometimes it takes too long time to open page. When page loads see <code>Read maps.gstatic.com</code>. When removed <code>&lt;script src="http://maps.google.com/maps/api/js?sensor=true"&gt;&lt;/script&gt;</code> page loads fast.</p>
  
  <p>So decided to start to load <code>&lt;script src="http://maps.google.com/maps/api/js?sensor=true"&gt;&lt;/script&gt;</code> only when other part of document loaded.</p>
  
  <p>Tried</p>
  
  <pre><code>$(document).ready(function() {
  $.getScript("http://maps.google.com/maps/api/js?sensor=true");
  });
  </code></pre>
  
  <p>But get error <code>uncaught exception: Google Maps API is required. Please register the following JavaScript library http://maps.google.com/maps/api/js?sensor=true.</code></p>
  
  <p>Tried also this <a href="https://developers.google.com/maps/documentation/javascript/examples/map-simple-async" rel="nofollow">https://developers.google.com/maps/documentation/javascript/examples/map-simple-async</a> outside document ready</p>
  
  <pre><code>function loadScript() {
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'http://maps.google.com/maps/api/js?sensor=true';
    document.body.appendChild(script);
  }
  window.onload = loadScript;
  </code></pre>
  
  <p>Got the same error</p>
  
  <p>What to change to get to load google maps script only after other content loaded?</p>