For some reason this does not loop through each object in my Ajax response into the array properly, I'm banging my head against a wall with this now.
My Ajax response is as follows...
{type:'blog_post',date:2013-30-12,title:'Blog Post',width:450,content:'qweqwe'},{type:'blog_post',date:2013-30-12,title:'Blog Post',width:450,content:'qweqwe'}
and here is the code...
var getTimelineData = function() {
var tldata = [];
$.get('/data/timeline_data', function(data) {
$.each(data, function(i, val) {
tldata.push(val)
console.log(val);
});
});
return tldata;
};
The console log returns the exact response not as an individual array item.