|  | removeEventListener when you don't know the object or functi |  | |
| | | Andrew Poulos |  |
| Posted: Mon Sep 01, 2008 9:32 am Post subject: removeEventListener when you don't know the object or functi |  |
Is there a way to call removeEventListener when you don't know what events may have been added?
With something like object.onclick = blah; I could run through every element in the page, search for onclick and set it to null.
When people use addEventListener and don't keep a record of the events they add it to I don't know how to find them.
Andrew Poulos |
| |
| | | Bjoern Hoehrmann |  |
| Posted: Mon Sep 01, 2008 1:09 pm Post subject: Re: removeEventListener when you don't know the object or fu |  |
* Andrew Poulos wrote in comp.lang.javascript:
| Quote: | Is there a way to call removeEventListener when you don't know what events may have been added?
|
No. You could try to override the addEventListener function before any listener is added and use that information, or you could generate a list of "all" probable event names and use them all, but other than that this is not possible. Browser-internal APIs might help you, if this is for a browser extension of some sort. -- Björn Höhrmann · mailto:bjoern@hoehrmann.de · LINK |
| |
|
|