Completed

Javascript Code: JSON to table (div)

This project was successfully completed by MinorityPath for $25 USD in a day.

Get free quotes for a project like this
Employer working
Completed by:
Skills Required
Project Budget
$10 - $30 USD
Completed In
1 day
Total Bids
11
Project Description

I have a website which should show products and prices that should be called from a JSON file. the JSON file structure looks like that and has about 300 entries:

[{"id":"22","name":"Dock Connector mit Flexkabel weiss","inventory":"3","price":"59"},{"id":"23","name":"Akku","inventory":"-1","price":"49"},{"id":"24","name":"Power \/ Volume Flex","inventory":"12","price":"59"},{"id":"25","name":"Lautsprecher Ear","inventory":"0","price":"49"},{"id":"26","name":"LCD \/ Digitizer Assembly schwarz","inventory":"12","price":"139"}]

What I need is a Javascript code snippet that calls single items from a JSON file (e.g. item with the id "25" and "26") and puts the "name" and the "price" of those items inside a table (within a div tag). I already have a Javascript which calls the whole content of the JSON:

<div id="displayprices"></div><script type="text/javascript">
[url removed, login to view]("[url removed, login to view] [url removed, login to view]",
function(data) {
[url removed, login to view](data, function(key, val) {
var tr=jQuery('<tr></tr>');
[url removed, login to view](val, function(k, v){
jQuery('<td>'+v+'</td>').appendTo(tr);
});
[url removed, login to view]('#displayprices');
});
});
</script>

I need this to be done within 24 hours.

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online