yes, but why doesn't interruption work even if the callback function
fromonkeyup event is called with a setTimeout ?

Dan G. Switzer, II wrote:
> 
> 
>>function Populate(instance_en_cours)
>>{
>>      rowsToShow = culmsName.contains(tbxValue).parent();
>>      rows.not(rowsToShow).each(function(){
>>              if(instance_fonction!=instance_en_cours)
>>              {
>>                      return false;
>>                      alert("interruption");
>>              }
>>              $(this).hide();
>>      });
>>      rowsToShow.each(function(){
>>              if(instance_fonction!=instance_en_cours)
>>              {
>>                      return false;
>>                      alert("interruption");
>>              }
>>              $(this).show();
>>      });
>>}
> 
> If I replace your Populate() with the following:
> 
> var oCells = null;
> 
> function Populate(instance_en_cours)
> {
>       if( oCells == null ) oCells = $("td.Name");     
> 
>       var sCurrent = tbxValue;
>       
>       oCells.each(
>               function (){
>                       var c = $(this), p = c.parent();
>                       
>                       p[0].style.display =
> (c.text().toLowerCase().indexOf(sCurrent) > - 1) ? "" : "none";
>               }
>       );
> }
> 
> I get really good performance. 
> 
> The biggest hit comes after the first key press when the oCells code runs.
> You could probably cache that at an earlier time. I tried doing it at
> $(document).ready() but it seems like you move those items during the
> window.onload event--so it makes the cache obsolete.
> 
> -Dan
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/jquery-is%27nt-very-effective-at-execution-tf3887482s15494.html#a11071830
Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to