title: Why is Bing Maps 7 AJAX control not lazy-loading?
body: <p>I'm trying to use Bing Maps 7.0 API with Lazy Loading, as this seem to be supported with the onScriptLoad parameter. I used this minimal test case:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;title&gt;Bing Maps Test&lt;/title&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id='mapDiv' style="position:absolute; width:600px; height:400px;"&gt;&lt;/div&gt;
      &lt;script type="text/javascript"&gt;
  
          function initMap() {
              console.log('Callback called');
              var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), {credentials:"&lt;API KEY&gt;"});
          }
  
          function loadMapControl() 
          {
              var script = document.createElement("script");
              script.setAttribute("src", "http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&amp;onScriptLoad=initMap");
              script.setAttribute("type", "text/javascript");
              document.documentElement.firstChild.appendChild(script);
              console.log('Tag appened');
          }
          setTimeout(loadMapControl, 1000);
  
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The callback is called as expected, but Firebug throws me an <code>Microsoft.Maps.Map is not a constructor</code> error. This even if I delay the map creation by 10 seconds after the callback is called via setTimeout.</p>
  
  <p>The simple example in Bing docs, however, is working perfectly:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;title&gt;Bing Maps Test&lt;/title&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
      &lt;script charset="UTF-8" type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id='mapDiv' style="position:absolute; width:600px; height:400px;"&gt;&lt;/div&gt;
      &lt;script type="text/javascript"&gt;
          var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), {credentials:",API KEY&gt;"});
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Has anybody succeeded in getting the API 7.0 to work with lazy loading?</p>
  
  <p>Thanks.</p>