Last active
December 26, 2015 17:59
-
-
Save aquajach/7191513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var current_directory = 'downloads'; | |
$.get('adminajax.php', {'action':'getDirectory', 'directory':current_directory}, function(data){ | |
$('#files .files').html(data); | |
deleteUser(); | |
}); | |
$.get('adminajax.php', {'action':'getUsers'}, function(data){ | |
$('#users .users').html(data); | |
deleteUser(); | |
}); | |
function deleteUser(){ | |
var username = $('.delete').siblings('a').html(); | |
console.log(username); | |
$('.delete').click(function(){ | |
$.ajax('adminajax.php', {'type':'DELETE','action':'deleteUser', 'user':username}, function(data){ | |
alert('The user has just been deleted!'); | |
}); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment