[jQuery] Plugin design pattern (common practice?) for dealing with private functions

2010-01-13 Thread Tim Molendijk
Hey all, I've been developing jQuery plugins for quite some time now, and I like to think I got pretty good at it. One issue keeps nagging me though, and that is how to deal with private functions in a powerful yet elegant manner. My plugins generally look something like this: (function($) {

Re: [jQuery] Plugin design pattern (common practice?) for dealing with private functions

2010-01-13 Thread Matt Maxwell
Maybe try using something like: $.myplugin.fill.call( this, red ); On Wed, Jan 13, 2010 at 6:47 PM, Tim Molendijk taw.molend...@gmail.comwrote: Hey all, I've been developing jQuery plugins for quite some time now, and I like to think I got pretty good at it. One issue keeps nagging me

Re: [jQuery] Plugin design pattern (common practice?) for dealing with private functions

2010-01-13 Thread Matt Maxwell
Also, more information on the call function (if you're not familiar with it) can be found here: https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Function/call https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Function/callYou could also use the apply