http://fra.orkos.com/produits/tarifs.aspx Here  is a page which I made. This
page presents a list of products classified in a hierarchy. I have a textbox
that allows the user to filter these products. Try to type a text in this
textbox (for example the word "apple") and observe the speed of filtering.
If you have a sufficient screen resolution you can also see that the
hierarchy at left hand side is filtered at the same time. The only problem
is that I need a hundred lines of script to do this...
When I discovered jquery, I wanted immediately to remake this script to see
how shorter the script could be. I was however quickly stopped by the
performances... Here, you can see the  http://fra.orkos.com/tests/pricelist/
same page  but the research script has been replaced by two jquery lines of
code. (the script is slow and may blocks the browser during a few seconds.
Do not stop script, it will not block you a long time)

$(".Name").parents("tr").hide(); //hide all the lines
$(".Name:contains('"+tbxValue+"')").parents("tr").show(); //then display the
lines in which the column "Name" contains the text researched

You can see how this second script is slow. Moreover, I didn't mask the
empty categories or filter the hierarchy at left hand side as in the first
script...

Maybe I could increase a little the performance by writting these two lines
of code differently, but the gap of performance between those two scripts is
so huge, that I wonder if using jquery with such page is a good choice.
Could you give me your advice ?
-- 
View this message in context: 
http://www.nabble.com/jquery-is-slow-at-execution-tf3898682s15494.html#a11052260
Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to