How to Pass Arguments to an Event Handler Callback in Javascript

Jump to: navigation, search

The example below is not generalized but illustrates the approach. Wrap the event handler callback function with another function keyword. You can then pass as many arguments as you want. example.contentLoaderInfo.addEventListener( air.Event.COMPLETE, function(event){doMyFunction(event, arg1, arg2)}); There are ways to do this if you have bound events with jQuery. I will update this article when I verify an approach that works.

See also

Use your Android as a Genie garage door opener remote

Personal tools
Namespaces
Variants
Views
Actions
Navigation