I am getting the JSON response from a Ajax call like this below:
{"Key1":"Value1" , "Key2":"Value2" , "Key3":"Value3" , "Key4":"Value4" }
I need create a table like
KEYS VALUES
Keys1 Value1
Keys2 Value2
Keys3 Value3
Keys4 Value4
I have used to read the above JSON string through this function below
var resData = {
"Key1": "Value1",
"Key2": "Value2",
"Key3": "Value3",
"Key4": "Value4",
};
JSON.parse(resData, function (k, v) {
alert(k); // It shows Key value
alert(v); // It shows value
});
I couldn't achieve to build using this function. So, please help me to tweak this code or with new code to build the HTML table dynamically using the JSON keys and Values.