Hello,
according my tests for removing an eventlistener definied for a anonymous function i found a solution, but i doesn't know why this works.
var myExtension = {
init: ....
},
onPageLoad: function(aEvent) {
var test = "test";
doc.addEventListener("textAreaEvent", afunc = function(evt){onChangeTextArea(evt, data);}, false);
....
},
onPageUnload: function(aEvent) {
//alert(test); <---- of course unknown
alert(afunc); <----Why is afunc known here?
aEvent.originalTarget.removeEventListener("textAreaEvent", afunc, false);
Can somebody give me an explanation why this workarround works and afunc is well known for onPageUnload? There is no global var afunc defined it was only done in addeventlistener.