Answer the question
In order to leave comments, you need to log in
It is necessary to make a button, by clicking which the user will join the VK group, how to implement it?
Tried doing this.
$(".buttonVK").click(function(event){
event.preventDefault();
VK.init({
apiId: 0000
});
function authInfo(response) {
if (response.session) {
console.log('user: '+response.session.mid);
} else {
console.log('not auth');
}
}
VK.Auth.login(authInfo);
VK.Auth.getLoginStatus(authInfo);
VK.Api.call('groups.join', {group_id: 0000}, function(){});
});
Answer the question
In order to leave comments, you need to log in
This method is for apps only, not for websites. Place the public widget on the site, it has an entry button, whoever needs it will click. There is a second way, black and both the site itself and the public are banned for it - you make the aforementioned block invisible and put it under the cursor with a button, or above the button you need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question