I have some knowledge of javascript and jquery and ajax I am making one app that will have multiple user on it and it has one complex json. How can we do it by getJSON and parse it in html. I want user a b c details like its image path and all how can we access that
{
"datas": {
"show_dashboard_access_page": false,
"login_status": "signedin",
"new_io": true,
"bst_users": [{
"userA": {
"user_logo": "image path",
"partner_since": "Jan 2013",
"status_now": "bronze",
"year_calculated": 2016,
"total": 300000,
"year_wise_usage": 123000,
"storage_wise_usage": 73000,
"server_wise_usage": 50000,
"order": 1
},
"userB": {
"user_logo": "image path",
"partner_since": "Feb 2014",
"status_now": "silver",
"year_calculated": 2016,
"total": 300000,
"year_wise_usage": 160000,
"storage_wise_usage": 60000,
"server_wise_usage": 100000,
"order": 2
},
"userC": {
"user_logo": "image path",
"partner_since": "Mar 2014",
"status_now": "silver",
"year_calculated": 2016,
"total": 300000,
"year_wise_usage": 180000,
"storage_wise_usage": 80000,
"server_wise_usage": 100000,
"order": 3
}
}]
},
"success": true
}
code that i have tried:
$.getJSON( "dummy.json", function( response ) {
//console.log(response.data.bst_users)
$.each(response.data.bst_users , function(key,val){
console.log(key)
var item = "<li> <img src='" + val["user_logo"] + "' alt=''/>" + "</li>";
$('ul').append(item)
})
});
Plz help