On Wed, 21 Mar 2007 17:20:22 -0400, Scott Sauyet wrote:
> One caveat, though, is that you are tying this functionality very 
> closely to the exact HTML structures you are using.  It's essentially a 
> screen-scraping technique, and if you decided to change the HTML in some 
> way so that the .resultPrice is not inside the .searchResult, you would 
> also need to change this Javascript.

Those particular structures are fairly well set in stone as the
"searchResult" class is really a container div for the entire result. That
said, I appreciate the pointer.

> One alternate approach clears this up at the expense of duplicate data 
> being sent in the page: include in your output a Javascript array of the 
> data and the related id's, and then iterate through that array, hiding 
> and showing the related elements based on a function that runs against 
> the actual data.

This was something I considered because I was thinking about having some
filters which added elements that were not part of the original visible
dataset. That is, the user the decides to include some criteria that was
excluded on the initial search, but I think a return trip to the server
makes more sense in that scenario. I'm not sure the functionality is really
going to go that way at this point, though. Again, thanks for the advice.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to