Javascript examples for jQuery:Plugin
make sure 'this' refers to the object literal within the object literal
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> $(window).load(function(){//from ww w .j a v a2s . c o m var obj = { a: function() { return 2 }, b: function() { return 5+ this.a() }, } $('#hey').text( $.proxy(obj.b, obj) ); }); </script> </head> <body> <div id="hey"></div> </body> </html>