I was trying Google maps. I found this statement.
google.maps.event.addDomListener(window, \'load\', initialize);
what is the function of t
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.
window
load
initialize
I.e. it delays the Google Map related script until the page has finished loading.