Well, we saw by inspecting a simple code loop doing:

$A(this.elm.getElementsByTagName('A')).each(function(ahref,idx){

   if (!Element.hasClassName(ahref.parentNode,'disabled')){
       return;
    }
}

That hasClassName() in a "slowed" IE take the most part of the time.
Well I know this loop is ugly we should use ?

this.elm.down('A.disabled');

But it is an example. So my question is: should we use Element.hasClassName()
in a loop
or something more straight ?


On 6/12/07, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
>
>
> Hey,
>
> Jean-Philippe Encausse a écrit :
> > It seems this medthod is really time consuming compared to:
>
> It shouldn't.  It's actually as fast as it should get.  The code you
> posted as comparison was obviously truncated, what's the full version?
>
> I suspect the real cost in it is element extension, and you're on IE...
>   On an already-extended element, it should be very fast.
>
> Maybe there is an alternate way of achieving the overall processing
> you're going for (the loop, or whatever)?
>
> --
> Christophe Porteneuve aka TDD
> [EMAIL PROTECTED]
>
> >
>


-- 
Jean-Philippe Encausse - R&D Jalios SA
Jp [at] encausse.net - http://www.encausse.com - http://www.jalias.com
GTalk: jp.encausse [at] gmail.com - SMS: sms [at] jp.encausse.net
Mob: +33682125699 - Job: +33139239283 - Tel: +33139189015 - Fax:
+33958789015
Do it Once, Use it Twice ~ Do it Twice, Make It Once

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to