Advertisement
Guest User

Untitled

a guest
Jul 15th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 2.02 KB | None | 0 0
  1. $("body").delegate( "a.sendfeedback", "click", function( event ) {
  2.         event.preventDefault();
  3.         var url = $(this).attr('href');
  4.         // var parent      = $('#doclist');
  5.         // var error       = $('.alert-danger', parent);
  6.         // var success     = $('.alert-success', parent);
  7.         bootbox.confirm("Kirim email feedback ?", function(result) {
  8.             if( result == true ){
  9.                 $.ajax({
  10.                     type:   "POST",
  11.                     url:    url,
  12.                     beforeSend: function (){
  13.                     },
  14.                     success: function( response ){
  15.                         response = $.parseJSON(response);
  16.                         if(response.message == 'error'){
  17.                         // success.hide();
  18.                         // error.empty();
  19.                         // error.html(response.data).fadeIn('fast');
  20.                         console.log(response.log);
  21.                     }else if(response.message == 'success'){
  22.                         // error.hide();
  23.                         // success.empty();
  24.                         // success.html(response.data).fadeIn('fast');
  25.                         Command: toastr.success("Berhasil mengirim email feedback", "Kirim Feedback");
  26.                         toastr.options = {
  27.                           "closeButton": true,
  28.                           "debug": false,
  29.                           "positionClass": "toast-bottom-right",
  30.                           "onclick": null,
  31.                           "showDuration": "1000",
  32.                           "hideDuration": "1000",
  33.                           "timeOut": "5000",
  34.                           "extendedTimeOut": "1000",
  35.                           "showEasing": "swing",
  36.                           "hideEasing": "linear",
  37.                           "showMethod": "fadeIn",
  38.                           "hideMethod": "fadeOut"
  39.                         }
  40.                     }
  41.                     }
  42.                 });
  43.             }
  44.         });
  45.        
  46.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement