I want to use variables to get a specific value from my JSON.
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var jsonContent = JSON.parse(this.responseText);
var day = mon;
var name = abc;
var restaurants = jsonContent.name.table.day;
The variables "day" and "name" will be different everytime the code starts because I need different values from my JSON.
How can I solve this?