I'm struggling to use the data from an array called struct, which I am fetching through ajax. Here is my code:
var raw_data = null;
$.ajax({
url:path.url_respuesta_leer, async:false,
type:"post", dataType:"json", data:{form:id},
success : function(obj) {
var raw_data = obj.struct;
}
//console.log(raw_data) show: [Object, Object, Object] 0:Object label:"Some text"
});
var new_data = [ {"Title": raw_data[0].label } , etc...
The console keeps showing that it's undefined. I know it should be simple, but for some reason I can't figure it out. Any help would be appreciated.