[jQuery] Re: Function overriding

2008-03-03 Thread howa
On 3月4日, 上午12時37分, David Stamm <[EMAIL PROTECTED]> wrote: > I'm sorry, I thought you were trying to architect your own plugin to > make it easier to override for others. > > A useful technique when you're overriding someone else's function, is > to save a reference to the original implementation

[jQuery] Re: Function overriding

2008-03-03 Thread David Stamm
I'm sorry, I thought you were trying to architect your own plugin to make it easier to override for others. A useful technique when you're overriding someone else's function, is to save a reference to the original implementation right before you override it: // save a reference to the or

[jQuery] Re: Function overriding

2008-03-03 Thread howa
On 3月3日, 下午11時56分, David Stamm <[EMAIL PROTECTED]> wrote: > The function sayHello() is defined inside the function jQuery.example, > and is thus an "inner function" or "nested function". It exists only > when jQuery.example is executing. It cannot be accessed from outside > jQuery.example with

[jQuery] Re: Function overriding

2008-03-03 Thread timothytoe
You may find this article interesting... http://osteele.com/archives/2006/04/javascript-memoization On Mar 2, 11:50 pm, howa <[EMAIL PROTECTED]> wrote: > Consider I have a simple plugin, e.g. > > jQuery.example = function(name) { > > sayHello = function(str) { > alert("jQuery

[jQuery] Re: Function overriding

2008-03-03 Thread David Stamm
The function sayHello() is defined inside the function jQuery.example, and is thus an "inner function" or "nested function". It exists only when jQuery.example is executing. It cannot be accessed from outside jQuery.example without doing some magic with closures. When you tried to override sayH