Feature #16813
closedJSeventFuncCalls onunload
0%
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
Updated by Christoph Koehler almost 18 years ago
Uploaded new patch, the old one wasn't quite right, so just ignore that one. Sorry about that!
Updated by Martin Kutschker almost 18 years ago
Added a new patch which allows for arbitrary events.
Updated by Christoph Koehler almost 18 years ago
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.
Updated by Martin Kutschker almost 18 years ago
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.
Updated by Christoph Koehler almost 18 years ago
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.
Updated by Oliver Hader almost 18 years ago
Have a look how this is implemented in prototype.js event handlers ("_observeAndCache"):
http://dev.rubyonrails.org/browser/spinoffs/prototype/trunk/src/event.js#L61
Updated by Martin Kutschker almost 18 years ago
My point was not how, but if we should use evebt listeners.
Updated by Oliver Hader almost 18 years ago
Okay :) IMHO we should use event listeners.