Yes.  That creates a single scope for all the plugin code and allows you to
use $() inside that scope.  Handy when the next user comes along that
doesn't use the $() alias for jQuery() (e.g., because they also use
Prototype or another library), while keeping the plugin code tight.

Scott

On Sun, Apr 27, 2008 at 8:25 PM, s.ross <[EMAIL PROTECTED]> wrote:

> Righto. Also, there might be some benefit in wrapping w/
> (function($) {
>   // stuff
> })(jQuery);
>
> Yes?
>
> I have a couple of extend's to do that will make things work much more
> nicely.
>
> Thx for the comments.
>
>
> On Apr 27, 2008, at 5:23 PM, Scott Trudeau wrote:
>
>
> To be a little more specific, for example, do this:
>
> var e = $('form input:visible');
>
> Not:
>
> e = $('form input:visible')
>
>
> On Sun, Apr 27, 2008 at 8:11 PM, Mike Alsup <[EMAIL PROTECTED]> wrote:
>
> >
> > >  Comments welcome!
> >
> > I'd recommend not using global vars.  Both of those plugins are doing
> > so.
> >
>
>
>
> --
> --
> Scott Trudeau
> scott.trudeau AT gmail DOT com
> http://sstrudeau.com/
> AIM: sodthestreets
>
>
>


-- 
--
Scott Trudeau
scott.trudeau AT gmail DOT com
http://sstrudeau.com/
AIM: sodthestreets

Reply via email to