Easy Tutorial
❮ Misc Extend Jquery Ref Ajax ❯

jQuery $.proxy() Method

jQuery Event Methods

Example

Enforce the context of the "test" function within the objPerson:


Definition and Usage

The $.proxy method takes an existing function and returns a new function with a specific context.

This method is commonly used to add events to elements where the context points to a different object.

Note: If you bind the function returned by $.proxy, jQuery can still unbind the correct function by passing the original function.


Syntax 1

Syntax 2

Parameter Description
function The existing function to be called.
context The name of the object where the function resides.
name The existing function whose context will be changed (should be a property of the context object).

jQuery Event Methods

❮ Misc Extend Jquery Ref Ajax ❯