[jQuery] Re: Writing a plugin - tips needed

2007-10-17 Thread sgrover
Let me see if I got this right. I understand private/public just fine, but am not clear on the context here... So, I'll build a sample... jQuery.myObj = function (params) { //private stuff var pad = function(num) { if (num.toString().length 2) { return 0 + num; } return num;

[jQuery] Re: Writing a plugin - tips needed

2007-10-16 Thread George GSGD
From what I understand, jQuery.fn objects are for functions that add capabilites to a jQuery instance: jQuery.fn.myFunction = function() { ... } Would then allow you to do $('.myItem').myFunction(); There are some things you should ensure when using this approach (returning a jquery object for

[jQuery] Re: Writing a plugin - tips needed

2007-10-16 Thread sgrover
So, my use of jQuery.myObject = { . . . }; seems to be correct in this case. Thanks for clarifying the extends bit. Now I think I understand the documentation. And this might come in handy - I know of a couple of plugins I might set mine to extend. I'll wait till the core stuff is