Page is a not externally linkable
Fotiman - 1:41 pm on Aug 3, 2012 (gmt 0)
The map approach that I suggested should still work for you:
var priceMap = {
".myThumbnails img": my_data.Range.SmallFamily.firstOne.price,
".row:nth-child(1) img": my_data.Range.SmallFamily.Big.price,
".row:nth-child(2) img": my_data.Range.SmallFamily.small.price,
".row:nth-child(3) img": my_data.Range.SmallFamily.otheratt.price
};
The value on the left is the "key" in the map. The value I'm using as the key is the unique selector for the element to be associated with the value in the map. The value is whatever specific property in the JSON you've mapped to it. You just need to know what that property is going to be and enter it in this map. So you might have one value like:
my_data.Range.SmallFamily.firstOne.price
and another like:
my_data.Range.CosbyFamily.lastOne.price
But you define the explicit mapping. Trying to do something dynamic might be more difficult.