Skip to content

Instantly share code, notes, and snippets.

@aquajach
Last active December 26, 2015 17:59
Show Gist options
  • Save aquajach/7191513 to your computer and use it in GitHub Desktop.
Save aquajach/7191513 to your computer and use it in GitHub Desktop.
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