Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function add(){
- $("#vk_groups").html('');
- $(".wall").show();
- }
- function check(){
- var id, isMember;
- VK.api('users.get', function(data){
- id = data.response[0].id;
- });
- VK.api('groups.isMember', {group_id:'77739720', user_id: id}, function (data){
- if(data.response === 1){
- VK.api('wall.getReposts', {owner_id:'-77739720', post_id:'16'}, function(repost){
- var x = md5(id);
- for(var i=0; i<repost.response.profiles.length; i++){
- if(id == repost.response.profiles[i].id){
- $.ajax({
- type: 'POST',
- url: 'insert',
- data: {user_id:id, x:x},
- success: function(data){
- $(".lbl").html('Поздравляем!');
- $(".info").show();
- $(".group").html('');
- }
- });
- }
- else{
- console.log('babah');
- }
- }
- });
- }
- });
- }
- function update(){
- var id,
- nick = $("#nick").val();
- VK.api('users.get', function(data){
- id = data.response[0].id;
- });
- $.ajax({
- type: 'post',
- url: 'update',
- data: {nick:nick, id_x: md5(id)},
- success: function(data){
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement