Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(function(){
- $(".btnDelete").on('click',function(){
- event.preventDefault();
- var nama = $(this).parent().parent().children()[2];
- nama = $(nama).html();
- var tr = $(this).parent().parent();
- $(".modal").modal('show');
- $(".modal-title").html("Konfirmasi");
- $(".modal-body").html("Anda Yakin Ingin Menghapus <b>"+nama+"</b> ?");
- var href = $(this).attr('href');
- $(".btnYa").off();
- $(".btnYa").on('click',function(){
- $.ajax({
- 'url' : href,
- 'type' : 'POST',
- 'success' : function(result){
- if(result == 1){
- $('.modal').modal('hide');
- tr.fadeOut();
- toastr.success("Data Berhasil Dihapus");
- }
- }
- });
- });
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement