javascript - Making API Rest call using jQuery -
i'm trying make rest call jquery rest service. going consume data openmrs api. following instructors of this post.
now, made call , still stacking parsing object json , showing on html page. got problems in doing that. sharing code on this jsfiddle.
what different steps parse json response ?
to explore object , using chrome console. wrote line example of can consume data (observation in case):
`$('#result').html('<p>' + data[0].concept + '<p>');`
'
in example data object. si navigate through other object;
ex:
$('#result').html('<p>' + data.results[0].concept.display + '<p>');
on js put :
success: function (data) { console.log(data);
so can use chrome console see how object made. below partial exemple of console.log output:
object {results: array[15]} results: array[15] 0: object accessionnumber: null comment: null concept: object display: "patient record image" links: array[1] uuid: "raxa00000-0000-0000-0000-000000000023" __proto__: object
Comments
Post a Comment