Im having a little problem making this work:
Here is my json array pulled via ajax:
{
"message": [{
"title": "Account",
"id": 1
}, {
"title": "Content",
"id": 2
}, {
"title": "Other",
"id": 3
}]
}
here is javascript:
var items = [];
$.get("settings.php", {
getlink: 1,
}, function(json) {
$.each(json.message, function() {
items.push(this);
});
},"json");
console.log(items)
But for some reason items array is always empty [] I can see in firebug, json returned array, but I'm not able to push it.