i would say the opposite: for long term maintainability, is better to not rely
on a third party library to perform such a simple task. Also, we should use
more ES5, since also m$ endorsed it, writing polyfills when/if necessary.
var nodes = document.querySelectorAll('#x tr.zebra')
, i = 0
, node
while ( node = nodes[ i++ ] )
node.classList.remove('zebra')
On Jan 8, 2012, at 10:43 PM, hj wrote:
> I *REALLY* don't understand the concern about performance. Do you need
> to do this within an inner nested loop? How many rows, average and
> maximum, are likely to be candidates for this? Unless you're including
> jQuery only for its easy selection capability for *this* purpose
> (i.e., not for any other uses elsewhere in your scripts), then it
> almost certainly is better, for long term maintainability, to use
> jQuery rather than native methods. I'd probably cache the reference to
> '#x', and use that:
>
> $x = $('#x');
>
> // later on ...
>
> $x.find('tr.zebra').removeClass('zebra')
>
> --
>
> hj
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]
>
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]