body onunload="if (GUnload!='undefined') GUnload();" -igor
On Sat, Mar 29, 2008 at 10:51 AM, Zach Cox <[EMAIL PROTECTED]> wrote: > I'm using markup inheritance to reuse a base page template for all > pages on my site. Some of these pages include Google Maps. According > to best practices, the <body> element of the page needs an onunload > event handler that calls the GUnload() function to eliminate memory > leaks: > > http://code.google.com/apis/maps/documentation/introduction.html#LoadingMap > > I can't put this on the body element of the base page, since only a > few pages need it. I tried adding a BodyTagAttributeModifier in the > child page constructor but it did absolutely nothing to the body > element: > > add(new BodyTagAttributeModifier("onunload", true, new > Model("GUnload();"), this)); > > I understand the proper way to call onload Javascript is to use > IHeaderResponse.renderOnLoadJavasript() but there's nothing for > onunload. Is there any way for a child page to dynamically add an > onunload attribute to the page's body element? > > Thanks, > Zach > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
