Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- get variables from different objects in json


dupalo - 7:12 am on Aug 1, 2012 (gmt 0)


Well these are the variables,
my_data.Range.SmallFamily.firstOne.price
my_data.Range.SmallFamily.Big.price
my_data.Range.SmallFamily.small.price
my_data.Range.SmallFamily.otheratt.price
so there seems to be some kind of pattern like
my_data.Range.SmallFamily.*.price

What I want to do is this: loop through the json variables (say I have 4) and being able to get the numerical values from inside the "price" variables
and use that number to update the left properties of my images css. In other words, use that numerical value to move the images left in their container
Assume I have 4 images - see the html in the thread - each numerical value will be assigned to each images, so I am thinking, do I need some sort of loop?
that gets each value in "price" in json and copy it into each image css
I have one loop already in my script - it's the one you suggested - which allows me to grab the images I need from json, but as I said the problem with
it is that that loop (each function if you like) gets images that are all in the same object, whereas here I am attempting to get variables in a different
object.
Hope that's clear : - )
thanks


Thread source:: http://www.webmasterworld.com/javascript/4480672.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com