jQuery $.proxy() Method
jQuery $.proxy() Method
The $.proxy method is used to take an existing function and returns a new one with a particular context. It is useful for attaching events to an element where the context is pointing back to a different object.
Syntax:-
Its syntax is:- $(selector).proxy(context, name) , $(selector).proxy(function, context)
Further Explanation:-
Parameter | Description |
---|---|
function | The existing function to be called |
context | The name of the object where the function lies |
name | The existing function whose context will be changed |