1. Creates a blank function
2. Checks onload for a function.
2a. Sets the originial onload function as temp
3. calls the new function initMap() before the originial temp onload function.
Pretty cool!
Code:
var temp=function(){ return 1;};
if( window.onload )
{
//override "placeholder" with whatever already exists in onload
temp = window.onload;
}
window.onload=function(){ TheFunctionYouWantToCall(); temp();};
That’s excellent. I can actually use this right now at work. Thanks, Dan!
thanks dal! anything to further the cause.