A
A
Alex Alex2016-01-23 03:59:08
PHP
Alex Alex, 2016-01-23 03:59:08

How to compare in execute vk?

var a=API.groups.getById({"group_ids":"1","fields":"members_count,can_post"});

if (parseInt ([email protected]_post) != 0){
return "Можно писать";
}else{
return "Нельзя писать";
}

club1 can't write on the wall, but he writes that you can. Not the right conditions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ivan386, 2016-01-23
@GoldenEagle88

Looking at the return value

var a=API.groups.getById({"group_ids":"1","fields":"members_count,can_post"});

return [email protected]_post;

We get:
We were given an array instead of a number.
Accordingly, the code will be correct.
var a=API.groups.getById({"group_ids":"1","fields":"members_count,can_post"});

if (parseInt ([email protected]_post[0]) != 0){
return "Можно писать";
}else{
return "Нельзя писать";
}

We get:
response: 'Нельзя писать'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question