Skip to Content
0
Dec 15, 2006 at 10:41 AM

[Javascript] Difference between <bsp:findAndReplace> and pure Javascript

23 Views

Hi,

It might be more a question to Javascript experts...

I tried to use some session management done with a small appUnload() function ressembling to the one in the system BSP application

This works well (the function is trigerred) :

   <bsp:findAndReplace find    = "<body"
                       replace = "<body onUnload='appUnload();'"> <%-- Session Management --%>
   <htmlb:documentBody>   
   </bsp:findAndReplace>

This does <b>not</b> trigger the function :

<htmlb:documentBody onLoad = "document.getElementsByTagName('body')[0].onunload = ''appUnload();'">

I assume this is due to the fact that the onUnload is "set at runtime" in the second option but, still, it should work, shouldn' it ?

Many thanks in advance.

Best regards,

Guillaume