I only saw this because I was wondering exactly the same question!
arguments.callee your friend ...
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Functions_and_function_scope/arguments/callee
so you would
blah.addEventListener('click',function(e){ e.source.removeEventListener('click', arguments.callee); blee bloo bleep });
this works in the Titanium Appcelerator, so it should work in javascript too (because it is the same thing)
NB DO NOT add () to the end of arguments.callee in this example if you do not want to see ... bah dum tish! ,
In fact, if you do not want to use arguments.callee, this might also work (not verified):
blah.addEventListener('click', anyThingYouWantHere : function(e){ e.source.removeEventListener('click', anyThingYouWantHere); blee bloo bleep });
Where "anyYouWantHere" is any variable name you want ~, you actually "call" the function as you add it.
bharal
source share