jQuery | $.proxy() Method Last Updated : 19 Feb, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The $.proxy() Method in jQuery accepts an existing function and returns a new one with a particular context. Generally, it is used for attaching events to an element where the context is pointing back to a different object. Syntax: $(selector).proxy(function, context) $(selector).proxy(context, name) Parameter: This method accepts three parameters as mentioned above and described below: function: It holds the existing function name which is to be called. context: It shows the name of the object where the function lies. name: The function whose context is to be changed. Example 1: This example displays the context of h3 element. html <!DOCTYPE html> <html> <head> <title> jQuery $.proxy() Method </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <script> $(document).ready(function() { test = function() { this.txt = "Property of Object"; $("h3").click($.proxy(this.myClick, this)); }; test.prototype.myClick = function(event) { alert(this.txt); alert(event.currentTarget.nodeName); }; var x = new test(); }); </script> </head> <body style="text-align:center;"> <h1>Welcome to GeeksforGeeks!.</h1> <div style="background-color:green"> <h3>Geeks for Geeks.</h3> </div> </body> </html> Output: Before clicking on the heading text h3: After clicking on the heading text h3: Click on OK button: Example 2: This example call the objPerson object and display its content. html <!DOCTYPE html> <html> <head> <title> jQuery $.proxy() Method </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <!-- Script to illustrate $.proxy() Method --> <script> $(document).ready(function(){ var objPerson = { test: function() { $("h2").after("GeeksforGeeks"); } }; $("button").click($.proxy(objPerson, "test")); }); </script> </head> <body style="text-align:center;"> <h1>Welcome to GeeksforGeeks!.</h1> <div style="background-color:green"> <button>The $.proxy Method.</button> <h2></h2> </div> </body> </html> Output: Before clicking on the button: After clicking on the button: Comment More infoAdvertise with us Next Article jQuery | Misc get() Method A adeshsingh1 Follow Improve Article Tags : Web Technologies JQuery jQuery-Events Similar Reads JQuery | type() method This type() Method in jQuery is used to determine the internal JavaScript [[Class]] of an object. Syntax: jQuery.type( obj ) Parameters: The type() method accepts only one parameter that is mentioned above and described below: obj: This parameter is the object to get the internal JavaScript [[Class] 2 min read jQuery | Misc param() Method The param() method in jQuery is used to create a representation of an array or an object. This representation is created in a serialized way. This serialized values can be used in making an ajax request in URL. Syntax: $.param(object, trad) Parameter: object: Specifies an array or object to serializ 1 min read jQuery | get() Method In jQuery .get() method loads data from the server by using the GET HTTP request. This method returns XMLHttpRequest object. Syntax $.get( url, [data], [callback], [type] ) Parameters url : String containing the URL at which request is to be sent data : This is an optional parameter that represents 2 min read jQuery ajax() Method The jQuery ajax() method is used to perform asynchronous HTTP requests, allowing you to load data from a server without reloading the webpage. It provides a flexible way to interact with remote servers using GET, POST, or other HTTP methods, supporting various data formats.Syntax:$.ajax({name:value, 4 min read jQuery | Misc get() Method The get() Method in jQuery is used to get the DOM element specified by the selectors. Syntax $(selector).get(index) Parameters: This method accepts single parameter index which is optional. It is used to specify which of the matching elements to get by its index number. Example 1: This example uses 1 min read JQuery deferred.pipe() Method The deferred.pipe() method in jQuery is used to add utility method to filter, chain Deferreds.Syntax:deferred.pipe([doneFilter][, failFilter][, progressFilter])Parameters: This method accepts three parameter as mentioned above and described below:doneFilter: It is an optional function which is calle 2 min read Like