Feature #16813
closed
JSeventFuncCalls onunload
Added by Christoph Koehler almost 18 years ago.
Updated over 17 years ago.
Description
onunload didn't work with JSeventFunCalls but might be required, for example with Google Maps to fix some memory leaks with IE.
Attached is a patch that adds that feature just like onload:
$GLOBALS["TSFE"]->JSeventFuncCalls["onunload"][tx_bla]="GUnload();";
(issue imported from #M4701)
Files
Uploaded new patch, the old one wasn't quite right, so just ignore that one. Sorry about that!
Added a new patch which allows for arbitrary events.
Thanks Martin. I saw the duplicate load call and your comment whether it was necessary, and I am all for removing it. One should be enough.
More questions:
Should we change from document.onXXX to window.onXXX? onload and onunload belong to window not document, but others should stay with document.
OTOH the developer could simply use event listeners.
Not sure since both are valid and I am not a JS guy. I use it for Google Maps which requires the onload stuff to be in the body tag. So as long as I can still do that, I am good.
If they are different (couldn't find anything on Google about that), we could just add them as an option instead of including them all the time automatically.
My point was not how, but if we should use evebt listeners.
Okay :) IMHO we should use event listeners.
Also available in: Atom
PDF