Hi all, I wonder if you can help me again with some more json.
I have this json fragment:
cars_data={
"haveAlook": {
"xmlns:fo": "http://www.w3.org/1999/XSL/Format",
"xmlns:inlineData": "Lookup",
"CategoryAttributes": {
"attOne": "MyattOne",
"attTwo": "MyattTwo",
"attThree": "MyattThree",
"attFour": "MyattFour",
"attFive": "MyattFive",
"attSix": "MyattSix",
"attSeven": "MyattSeven"
},
"TheThumbnails": {
"thumb1": "first.png",
"thumb2": "second.png",
"thumb3": "third.png",
"thumb4": "fourth.png",
"thumb5": "fifth.png",
"thumb6": "sixth.png",
"thumb7": "seventh.png",
"thumb8": "eight.png",
"thumb9": "ninth.png",
"thumb10": "tenth.png",
"thumb11": "eleventh.png",
"thumb12": "twelfth.png",
"thumb13": "thirteenth.png",
"thumb14": "fourteenth.png",
"thumb15": "fifteenth.png",
"thumb16": "sixteenth.png",
"thumb17": "seventeenth.png"
},
...
What I am trying to achieve here is to get data from this json fragment using jquery/javascript and insert this data in my html (I know that if you haven't javascript enabled you can't do it and bla bla, but that's the way we have decide to implement this). The data I want to get out of the json are the thumbnail images. I have 17 images there that I want to place within the <a>
tag in my html. The json fragment is in my script where the rest of the functions are.
Here's the html in question:
...
<div class="vehicle_family odd">
<p>Small family</p>
<div class="vehicle_row">
<a href="javascript:void(0)"></a>
</div>
<div class="vehicle_row">
<a href="javascript:void(0)"></a>
</div>
<div class="vehicle_row">
<a href="javascript:void(0)"></a>
</div>
<div class="vehicle_row">
<a href="javascript:void(0)"></a>
</div>
<div class="vehicle_row">
<a href="javascript:void(0)"></a>
</div>
<div class="vehicle_row">
<a href="javascript:void(0)"></a>
</div>
<div class="vehicle_row">
<a href="javascript:void(0)"></a>
</div>
<div class="clear"></div>
</div><!-- END OF vehicle_family:small family-->
<div class="vehicle_family">
<p>Large family</p>
<div class="vehicle_row">
<a href="javascript:void(0)"></a>
</div>
<div class="vehicle_row">
<a href="javascript:void(0)"></a>
</div>
<div class="vehicle_row"> …