[jQuery] Re: Selector Efficiency?

2009-03-02 Thread Josh Rosenthal
Hi Stephan, Interesting. You're also right that I could separate out the layerType check. I'm using a OCG WMS to fetch a small block of KML objects surrounding a point (geoserver WMS with KML output). In response to a user query, I loop through the collection checking if the query coord is insid

[jQuery] Re: Selector Efficiency?

2009-03-02 Thread Stephan Veigl
Hi Josh, it looks like $foo.find(":header") has a problem since there is no single root element. Wrapping your data packet into would help: $foo = $(""+foo+""); but since you are after a speed optimization I would suggest: layerType = $(queryTarget[0]).text(); This gets the text of your fir

[jQuery] Re: Selector Efficiency?

2009-03-01 Thread Josh Rosenthal
Hi Stephen, My apologies for not getting back to you sooner. I've been sick and my projects have gotten away from me. We now return to the email I'd started writing before I lost track of everything. Thank you! Trebly so! First, yes, the data is ordered based on a template in geoserver th

[jQuery] Re: Selector Efficiency?

2009-02-19 Thread Stephan Veigl
Hi Josh, are your data ordered? (e.g. MAP_ID is the first , SITE_ADDRESS the second, ...) If yes you can use a index based approach (from 4.8ms to 0.9ms on IE). var $foo = $(foo); var data = $foo.find(".atr-value"); var parcelOutput = 'Parcel ID: ' + $(data[0]).text() + '' +