jsnoob4ik,
а data есть?
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
</head>
<body> <div id="box"></div>
<script>
var data = {
"items": [
{
"id": "01",
"text": "TEXT",
"likes": {
"count": 1,
"can_like": 1
},
"date": 0000,
"comments": {
"count": 1,
"can_post": 1
},
"attachments": [
{
"type": "photo",
"photo": {
"photo_130": "http://1.jpg",
"date": 0000,
"id": 01
}
}
]
},
{
"id": "02",
"text": "TEXT2",
"likes": {
"count": 2,
"can_like": 2
},
"date": 0000,
"comments": {
"count": 2,
"can_post": 2
},
"attachments": [
{
"type": "photo",
"photo": {
"photo_130": "http://2.jpg",
"date": 0000,
"id": 02
}
},
{
"type": "photo",
"photo": {
"photo_130": "http://3.jpg",
"date": 0000,
"id": 03
}
},
{
"type": "photo",
"photo": {
"photo_130": "http://4.jpg",
"date": 0000,
"id": 04
}
}
]
}
]
}
var output="<div>";
for (var i in data.items) {
output+="<div>" + data.items[i].id + "</div>";
output+="<div>" + data.items[i].text + "</div>";
output+="<div>" + data.items[i].likes.count + "</div>";
output+="<div>" + data.items[i].comments.count + "</div>";
for (var k in data.items[i].attachments) output+="<div>" + data.items[i].attachments[k].photo.photo_130 + "</div>";
}
output+="</div>";
document.getElementById("box").innerHTML=output;
</script>
</body>
</html>