Answers for "on click modal show ajax"

1

jquery on modal show

$(window).on('shown.bs.modal', function() { 
    $('#code').modal('show');
    alert('shown');
});
Posted by: Guest on October-01-2020
0

modal ajax request,click link

$(document).ready(function(){

 $('.userinfo').click(function(){
   
   var userid = $(this).data('id');

   // AJAX request
   $.ajax({
    url: 'ajaxfile.php',
    type: 'post',
    data: {userid: userid},
    success: function(response){ 
      // Add response in Modal body
      $('.modal-body').html(response);

      // Display Modal
      $('#empModal').modal('show'); 
    }
  });
 });
});
Posted by: Guest on June-07-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language