[jQuery] Re: Slow selector

2007-05-23 Thread Gordon
I don't know why either, but when I did switch to class names the result was a big speed increase. I guess attribute selecting is a lot trickier to do than class matching. On May 23, 6:39 am, Klaus Hartl [EMAIL PROTECTED] wrote: Daemach wrote: You should definitely consider using a classname

[jQuery] Re: Slow selector

2007-05-23 Thread Gordon
I don't know why either, but when I did switch to class names the result was a big speed increase. I guess attribute selecting is a lot trickier to do than class matching. On May 23, 6:39 am, Klaus Hartl [EMAIL PROTECTED] wrote: Daemach wrote: You should definitely consider using a classname

[jQuery] Re: Slow selector

2007-05-23 Thread Gordon
I don't know why either, but when I did switch to class names the result was a big speed increase. I guess attribute selecting is a lot trickier to do than class matching. On May 23, 6:39 am, Klaus Hartl [EMAIL PROTECTED] wrote: Daemach wrote: You should definitely consider using a classname

[jQuery] Re: Slow selector

2007-05-23 Thread Gordon
I don't know why either, but when I did switch to class names the result was a big speed increase. I guess attribute selecting is a lot trickier to do than class matching. On May 23, 6:39 am, Klaus Hartl [EMAIL PROTECTED] wrote: Daemach wrote: You should definitely consider using a classname

[jQuery] Re: Slow selector

2007-05-23 Thread Gordon
I don't know why either, but when I did switch to class names the result was a big speed increase. I guess attribute selecting is a lot trickier to do than class matching. On May 23, 6:39 am, Klaus Hartl [EMAIL PROTECTED] wrote: Daemach wrote: You should definitely consider using a classname

[jQuery] Re: Slow selector

2007-05-23 Thread Klaus Hartl
Gordon wrote: I don't know why either, but when I did switch to class names the result was a big speed increase. I guess attribute selecting is a lot trickier to do than class matching. Ah, this is what I overlooked. Class selecting can just use the className property, whereas attribute

[jQuery] Re: Slow selector

2007-05-23 Thread RobG
On May 23, 1:29 am, Gordon [EMAIL PROTECTED] wrote: I am writing a script that scans a list of items that each contain form fields and doing something based on the value of the field in each item. I came up with the following code, which does seem to work as intended, but execution can

[jQuery] Re: Slow selector

2007-05-23 Thread Klaus Hartl
RobG wrote: If myElem is the ID of the form, that will containt all the child nodes, you will then iterate over all of them. To get just the controls with the same name: var controls = $('myElem').elements; This is completely Prototype syntax. In jQuery it looks like: var controls =

[jQuery] Re: Slow selector

2007-05-23 Thread Dan G. Switzer, II
If myElem is the ID of the form, that will containt all the child nodes, you will then iterate over all of them. To get just the controls with the same name: var controls = $('myElem').elements; This is completely Prototype syntax. In jQuery it looks like: var controls =

[jQuery] Re: Slow selector

2007-05-22 Thread Benjamin Sterling
Gordo, Could be wrong on this, but you should be able to do something like: $('[EMAIL PROTECTED]').each(function(){ thisVal = parseInt($(this).val()); }); I am pretty sure that will be faster, but not a 100% on that. -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com

[jQuery] Re: Slow selector

2007-05-22 Thread Rob Desbois
How about using a class? I haven't tested it but I believe this is faster than using field names to filter on. --rob On 5/22/07, Gordon [EMAIL PROTECTED] wrote: I am writing a script that scans a list of items that each contain form fields and doing something based on the value of the field

[jQuery] Re: Slow selector

2007-05-22 Thread Gordon
The children of the container are the elements that decisions are going to be made on based on the values of form fields inside them, so doing the each on the fields directly isn't an option. I'm going to use the classes idea, which seems more practical for what I want. Thanks. On May 22, 4:29

[jQuery] Re: Slow selector

2007-05-22 Thread Daemach
You should definitely consider using a classname to select items like this. $('input.quantity') would be significantly faster. On May 22, 8:29 am, Gordon [EMAIL PROTECTED] wrote: I am writing a script that scans a list of items that each contain form fields and doing something based on the

[jQuery] Re: Slow selector

2007-05-22 Thread Klaus Hartl
Daemach wrote: You should definitely consider using a classname to select items like this. $('input.quantity') would be significantly faster. I don't know why using a class name would be significantly faster. Since there is no doucment.getElementsByClassName (yet), it doesn't make much