My apologies for using the dev forum as a user forum :) Many thanks John for this - in 1.2 it was the only was I (rightly or wrongly) could get the id of the first parent fieldset that had an id - it was a bit of a shock that is slowed down so much in 1.3. Having said that, the issue is now mute - I hadn't noticed closest() had appeared in 1.3, but as usual, jQuery seems to be able give me exactly what I need in an even more concise manner...
If only I could read it's mind as well as it tries to read mine :) All the best. On Feb 18, 6:13 pm, John Resig <jere...@gmail.com> wrote: > Are you sure you meant :has([id])? That would find all fieldsets that > have a descendant that has an ID attribute (which is pretty costly). > It sounds like you could replace that line with: > > jQuery(this).closest("fieldset[id]") > > --John > > On Wed, Feb 18, 2009 at 11:34 AM, GreyCells <oldgreyce...@googlemail.com> > wrote: > > > I'm sure this is not the most elegant line of code, but in 1.2.6, > > there was no performance hit (i.e. a moderately complex page/form > > loaded in the blink of an eye). In 1.3.1 this now takes > 10 seconds > > with 100% cpu: > > > var parentWithIdAttribute = jQuery(this).parents('fieldset:has > > ([id]):first').attr('id'); > > > This is used to determine the context of a bunch of labels and legends > > within a selector.each(). > > > Commenting out this single line restores the performance (but > > obviously breaks my app). > > > Not sure whether I should raise this as a bug...? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---