Every 2 seconds, I send out a POST that returns:
[{"a":false,"i":"58","b":"sergio","p":"0,22","t":15},
{"a":false,"i":"59","b":"sergio","p":"0,23","t":15},
{"a":false,"i":"60","b":"sergio","p":"0,14","t":15},
{"a":false,"i":"61","b":"sergio","p":"0,07","t":15}]
I have a Javascript function that captures this information and I'd like it to also parse the JSON and place the values into their appropriate elements.
function updateauctions(response) {
//Parse JSON and place into HTML elements.
//For debug purposes.
alert(response);
}
I'm using jQuery and I'd like to know how to fetch JSON values, and place them into HTML elements.
An example of a div .auctionbox:
<div id="60" class="auctionbox gold">
//Other things here.
</div>
For example, I have n amount of divs with class .auctionbox and each one of those divs also has an ID of #i. So each JSON object corresponds to a single .auctionbox. How would I place the p value of the JSON into the appropriate #i, .auctionbox?
With this simple example, I can start working on other requirements, I just need a little nudge. :)
Thank you.