Advertisement
Guest User

tag script

a guest
Jan 20th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.61 KB | None | 0 0
  1. <script type="text/javascript">
  2.         $(document).ready(function(){
  3.             function ajax_delete_user(){
  4.                 let currentId = current_user()
  5.                 console.log(current_user);
  6.                 $.ajax({
  7.                     url: '/alunos/del/'+ document.getElementById('_id').value,
  8.                     data: valorId,
  9.                     type: 'GET',
  10.                     success: function(response){
  11.                         console.log(response);
  12.                     },
  13.                     error: function(error){
  14.                         swal("Ops, algo deu errado","ERRO","error");
  15.                         console.log(error);
  16.                     }
  17.                 });
  18.             }
  19.  
  20.             $("#trash").click(function(event){
  21.                 event.preventDefault();
  22.                 ajax_delete_user();
  23.             });
  24.  
  25.         });
  26.            
  27.                
  28.         </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement