Answer the question
In order to leave comments, you need to log in
VK OpenAPI wall.get js?
Good night, I ran into a problem I can’t solve
The problem is to load images from VK using the wall.get method
Do it like this
VK.Api.call('wall.get', {domain: 'mirfactov', count: 15, offset: 1}, function(r) {
console.log(r.response);
for(var i = 1; i < count(r.response); i++)
{
if(r.response[i].attachment)
{
switch(r.response[i].attachment.type)
{
case "photo": {
for(var n = 0; n < count(r.response[i].attachments); n++)
{
console.log(r.response[i].attachments[n].photo.src + " number: " + n);
}
break;
}
}
}
}
});
TypeError: r.response[i].attachments[n].photo is undefined
if(r.response[i].attachments[n].type == "photo")
{
console.log(r.response[i].attachments[n].photo.src + " number: " + n);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question