var own_id = '1'; //ID сообщества
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.vk.com/method/wall.get?owner_id=-'+own_id+'&count=1&v=5.64', true);
xhr.onload = function() {
console.log( JSON.parse(this.responseText).response.count );
}
xhr.onerror = function() {
console.log( 'Ошибка ' + this.status );
}
xhr.send();
var own_id = '1'; //ID сообщества
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.vk.com/method/wall.get?owner_id=-'+own_id+'&count=1&v=5.64', true);
xhr.onload = function() {
console.log( JSON.parse(this.responseText).response.count );
}
xhr.onerror = function() {
console.log( 'Ошибка ' + this.status );
}
xhr.send();