[jQuery] Re: Performance Tuning Help

2008-01-24 Thread besh
Hi Raymond, I'm not sure if this is less cpu intensive, but at least it's more jQuery: $('div.box').each(function() { var $snippet = $(this).find('dd p').html(); $(this).append('div class=summaryp class=sml' + $snippet + '/p/div'); }); -- Bohdan Ganicky On Jan 24, 12:01 am, Raymond [EMAIL

[jQuery] Re: Performance Tuning Help

2008-01-24 Thread Shawn
The other suggestions are good starting points. One comment though... doing $(div.box) needs to examine EVERY div on your page to see if it has the .box class. If you can constrain that search some that could help improve performance. For instance, if you only care about the div's in a

[jQuery] Re: Performance Tuning Help

2008-01-24 Thread Karl Swedberg
On Jan 23, 2008, at 11:58 PM, Joel Birch wrote: Or this (untested): $('div.box').each(function(){ var $$ = $(this); $$.append('div class=summaryp class=sml' + $$.find('dd p').html() + '/p/div'); }); Joel Birch This looks good. I wonder if a tiny bit of performance could be

[jQuery] Re: Performance Tuning Help

2008-01-24 Thread Raymond
Thanks to everyone for the suggestions. All were faster than the original but I went with Joel's as it seems to be the quickest. Thanks again!

[jQuery] Re: Performance Tuning Help

2008-01-23 Thread Aaron Heimlich
Try this (untested): $('div.box').each(function(count, box) { $(box).append('div class=summaryp class=sml' + $('dd p', box).html() + '/p/div'); }); On Jan 23, 2008 5:01 PM, Raymond [EMAIL PROTECTED] wrote: I was wondering if anyone knows of a less processor intensive way of doing the

[jQuery] Re: Performance Tuning Help

2008-01-23 Thread Joel Birch
Or this (untested): $('div.box').each(function(){ var $$ = $(this); $$.append('div class=summaryp class=sml' + $$.find('dd p').html() + '/p/div'); }); Joel Birch