I agree with jdalton - performance hit.
I agree also that you shouldn't use the same values for name's and
id's.
$() is made for one purpose - to find elements with given id. It
should be VERY fast in every case as it's a base function of
Prototype.
IMO, if found' element's id isn't the same as given, maybe function
should even return null:
[...]
if (typeof element == 'string')
{
var id=element;
element = document.getElementById(element);
// not found
if (element === null || !element.id || element.id!=id) {
return null;
}
}
return Element.extend(element);
[...]
On Jun 17, 11:36 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Wait for your solution, however this performance hit only occur in the
> ie and opera and you select the input without an id attribute, maybe
> 1%'s probability. Will $$("*").detect take a very long time? long than
> 2 seconds? Is that posibble? Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" 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/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---