java - How to read key-value pairs from a list of hashmaps which is in the form of json in jquery script? -
context : json,jquery,java
the json object :
[{"7818.0":".net developer"},{"6124.0":".net off shore support project manager"},{"6125.0":".net off shore support project member"},{"6922.0":"2 apac inventory orgs under spsw manager"}]   the code in jquery :
var roles = <%=request.getattribute("rolelist")%> $.each(roles, function(object) {                 //display key , value pair                 alert(object.key);                 alert(object.value);             });   any suggestions appreciated
you can change code :
$.each(roles, function(key,value) {    (var in value) {       alert("key: "+i);       alert("value: "+value[i]);    }                  });   get key , value map.
here's working fiddle: https://jsfiddle.net/pr21ojof/
Comments
Post a Comment