What is the function of google.maps.event.addDomListener(window, 'load', initialize);?

I was trying Google maps. I found this statement.

google.maps.event.addDomListener(window, 'load', initialize);

what is the function of that statement ?

  • Same origin host, different ports in JS
  • Javascript focused control
  • Is document.links faster in finding a link using jQuery?
  • localStorage not storing persistently between two pages
  • JavaScript closures and variable scope
  • Creating anchor tags dynamically in HTML using JavaScript
  • How can I tell if a page has jumped to the anchor (#) in javascript?
  • CoffeeScript - Referencing DOM nodes in Angular expressions is disallowed
  • How to get parent element in jQuery when child element is known?
  • Get some parent element ID in order to send to javascript function
  • Which is the most memory leak safe approach
  • Can I get meta “properties” using Javascript?
  • 2 Solutions collect form web for “What is the function of google.maps.event.addDomListener(window, 'load', initialize);?”

    It adds a listener to the window object, which as soon as the load event is triggered (i.e. “the page has finished loading”) executes the function initialize.

    I.e. it delays the Google Map related script until the page has finished loading.

    @Dust function is initialize and it is called only after the element is loaded.
    in maps.event…. , i think event is div element because essentially it contains the map-canvas information.