Gil Gil - 1 year ago 76
Ajax Question

Get data from multiple objects from ajax api call

i have multiple objects as response from an api call with Ajax, how do i "print" the data that's inside the object?

url: 'url',
dataType: 'json',
type: 'post',
contentType: 'application/json',
data: JSON.stringify( { parameters } ),
processData: false,
success: function( data ){
console.log(data); <- this log all objects, i want the info inside the objects

enter image description here

how do i print every single "variable" for each object, or storage on an array.

Answer Source

If you want only to see the data,


If you want to use the data, you have to iterate over the array and access each object separately, or use come collection methods ( see libraries such as underscore or lodash ( )

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download