If you need to add onload and onunload events to a page where you have
no access to the BODY html tag then try this:

if(window.addEventListener){ window.addEventListener( "load",
myOnload, false ); } else { window.attachEvent( "onload",
myOnload ); }
if(window.addEventListener){ window.addEventListener( "unload",
GUnload, false ); } else { window.attachEvent( "onunload",
GUnload ); }

myOnload() being a function you've defined to execute on page load.

GUnload() being the API function to execute when a page is unloaded -
it frees memory used by the API once no longer needed.

Martin.



On 11 June, 17:22, Rossko <[email protected]> wrote:
> > My code:http://www.sgitest.com/nw2/nw_unity2.htm
>
> > Their test page incorporating the above 
> > code:http://www.nationwidechildrens.org/gd/templates/pages/pfv/PFV.aspx?pa...
>
> Your page includes -
> <body onload="initialize()" onunload="GUnload()"
> Theirs doesn't.
>
> CMS often mess with <body>, you'd be better using 
> window.onloadhttp://javascript.about.com/library/blonload.htm
> but beware if there may be multiple onload functions
>
> cheers, Ross K
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to