Try this: var Example = function(){}; Example.prototype = {
abobora: function(){ alert('Hi!'); }, execute: function(){ var t = this; $('#any_button').click(function(){ t.abobora(); }); } }; - ricardo On Nov 27, 7:39 am, "Yam." <[EMAIL PROTECTED]> wrote: > I met a small problem that an outside 'example' object does not be got > in a 'click' function. > would you tell me how to do that? > > == > example code: > == > > var Example = function(){}; > Example.prototype = { > > i_want_to_call_this_function: function(){ > alert('Hi!'); > }, > > execute: function(){ > $('#any_button').click(function(){ > > // How to call 'i_want_to_call_this_function' from here? > > // this.i_want_to_call_this_function(); // -> Unknown. i know a > 'this' object pointed to html object. > > }); > } > > }; > > var example = new Example(); > example.execute();