$('.btn-delete').click(function(){
var prm_delete = $.ajax({
type: 'POST',
url: '/gateway/delete',
data: {id: $(this).attr('id')}
});
prm_delete.done(function(data){
//how do I get the button?
//$(this) does not work
});
});
Above is my delete button code, I use a promise to send the id of the button. When the promise is done I need to get the button that was pressed so I can highlight it.
I'm having trouble with scope as done runs a function, how can I pass in the button that was pressed?