Share via


Type.createCallback Method

Creates a callback method that retains a parameter, given the function to call back and the parameter to pass to it.

public static function createCallback(
    method : Function,
    context : Object
) : Function

Parameters

Parameter

Description

method

The function for which the callback method will be created.

context

The parameter to pass to the function. This parameter can be null, but it cannot be omitted.

Return Value

The callback function.

Remarks

Use this method to set up a handler for a DOM event that retains a parameter. The callback function will be called with the DOM event as the first parameter and context as the second parameter.

See Also

Reference

Type Class