title: DIV onload Not Firing JavaScript Method
body: <p>I am using ASP.NET MVC 4 and I have a DIV like this:</p>
  
  <pre><code>&lt;div id="map_canvas" style="width: 500px; height: 400px;" onload="mapAddress();"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Then, in a JavaScript file (<strong>that I've verified is loaded</strong>) is the <code>mapAddress</code> function:</p>
  
  <pre><code>function mapAddress() {
      //In this case it gets the address from an element on the page, but obviously you  could just pass it to the method instead
      var address = $("#Address").val();
  
      geocoder.geocode({ 'address': address }, function (results, status) {
          if (status == google.maps.GeocoderStatus.OK) {
              var myLatLng = results[0].geometry.location.LatLng;
  
              var mapOptions = {
                  center: myLatLng,
                  zoom: 15,
                  mapTypeId: google.maps.MapTypeId.ROADMAP
              };
  
              var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
  
              var marker = new google.maps.Marker({
                  position: myLatLng,
                  map: map,
                  title: $("#Name").val() + " Location"
              });
          }
          else {
              alert("The location of the event could not be mapped because: " + status);
          }
      });
  }
  </code></pre>
  
  <p>But for whatever reason it's not being called. Did I misunderstand the <code>onload</code> event?</p>
  
  <p>Thanks all!</p>