[jQuery] Re: does selectors $ cache?

2009-05-27 Thread Andy Matthews
No, it does not cache. Each time you make a page query, a new call is made. For better performance, always cache commonly used selectors: $myID = $('#myID'); // $ used for initial var to indicate a jQuery object var text = $myID.text(); var color = $myID.css('color'); Also, you should always use

[jQuery] Re: does selectors $ cache?

2009-05-26 Thread scoob...@gmail.com
I don't think it does.. If you did $('div#myid') then it would search through all the div's.. Here's a bit on jquery performance that I read about.. http://www.artzstudio.com/2009/04/jquery-performance-rules/ Hope that helps... On May 26, 10:44 pm, jonathan wrote: > does selectors cache? for e