I like translate my json-Data to an JS object or assign it to a variable..
$.ajaxSetup({
type: "POST",
url: "_class/queries.php",
dataType:"json"
});
var obj;
$.ajax({
data: querystring,
success: function(data){
console.log(data);
alert(data[0].vname);
//obj = JSON.parse(JSON.stringify(data));
obj = data;
console.log(obj[0].vname);//<-- prints the expected property
}
});
console.log("return "+obj);//<-- undefined?
return obj;
}
the alert print out the right property-value but somehow the eval-function produces an pars error? I've tryed jQuery.parseJSON but wont work either?