On 27/11/06, Brandon Aaron <[EMAIL PROTECTED]> wrote:
> On 11/27/06, Sam Collett <[EMAIL PROTECTED]> wrote:
> > Along with that, I have reduced the number of times 'attr' is used:
> >
> > i.e.
> > $("<a>").attr({'title' : 'Foo', 'rel'  : 'myrel', 'href' : 'javascript:;'})
> >
> > becomes:
> > $("<a>").title('Foo').rel('myrel').href('javascript:;')
>
> I'm curious why you have done this?
>
> Those helper methods might be deprecated from the core in the 1.1 release.
>
> --
> Brandon Aaron

Just personal preference, I think that also makes it more readable and
less prone to errors (when using attr you may miss off a , : { or }).
File size is also reduced (although only by about 100 bytes) - in a
very large plugin, using the helper methods could result in even more
reductions.

While I can see why the helper methods are removed, some are actually
applicable to all elements (id, title, lang, dir), so it may be good
to keep them in as they could be frequently used (at least id and
title).

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to