Answers for "jquery ajax get open modal on button click"

3

trigger modal from jquery

$('#myModal').modal('show');
Posted by: Guest on January-11-2021
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 "jquery ajax get open modal on button click"

Browse Popular Code Answers by Language