I've got a mass of values in a JSON file containing the names of venues and their contact information along with a description. I'd like to generate a table listing the contents of the JSON file on my page. I'm hoping to create a live search function that removes each entry that is no longer relevant with eachkeyUp
detected.
The JSON
[
{
"name": "Aquarium Café Bar",
"site": "http://www.aquariumcafebar.ca",
"address": "2923 Masson 728-6116",
"genre": "default"
},
{
"name": "Aréna Pierre “Pete” Morin",
"site": "none",
"address": "1925 St-Antoine 634-3471",
"genre": "default",
}
]
The Proposed HTML
<table>
<thead>
<tr>
<th>Venue</th>
<th>Address</th>
<th>Website</th>
<th>Genre</th>
</tr>
</thead>
<tbody>
<tr>
<td>Aquarium Café Bar</td>
<td>2923 Masson 728-6116</td>
<td>http://www.aquariumcafebar.ca</td>
<td>Rock</td>
</tr>
</tbody>
</table>
I've got a vague idea of how to grab the JSON from the venues.json file in jQuery, but I would really not know what to do with it once I have it to .append() a containing all the info. I'm just looking for a bit of help with the syntax here!
Oh, and if you happen to have any bright ideas about how to update the table as the user searches, it'd be greatly appreciated!
Love,
BenjiBee