Ajax call in Jquery

   

 



 AJAX stands for Asynchronous JavaScript and XML and a web development technique used to create interactive web applications. It is very easy to learn and understand if you know Java Script or Jquery.

<script>  
        $(document).ready(function () {  
            $.ajax({  
                type: "GET",  
                url: "/api/API/GetAllEmployees",  
                contentType: "application/json; charset=utf-8",  
                dataType: "json",  
                success: function (data) {  
                    //alert(JSON.stringify(data));                  
                    $("#DIV").html('');   
                    var DIV = '';  
                    $.each(data, function (i, item) {  
                        var rows = "<tr>" +  
                            "<td id='SnNo'>" + item.SNo + "</td>" +  
                            "<td id='Name'>" + item.name + "</td>" +  
                            "<td id='Address'>" + item.address + "</td>" +  
                            "<td id='PhoneNo'>" + item.phoneNo + "</td>" +  
                            "<td id='Date'>" + Date(item.Date,  
                             "dd-MM-yyyy") + "</td>" +  
                            "</tr>";  
                        $('#Table').append(rows);  
                    }); //End of foreach Loop   
                    console.log(data);  
                }, //End of AJAX Success function  
      
                failure: function (data) {  
                    alert(data.responseText);  
                }, //End of AJAX failure function  
                error: function (data) {  
                    alert(data.responseText);  
                } //End of AJAX error function  
      
            });         
        });  
    </script>

DOT NET ADDA

interested in solving the problems based on technologies like Amazon AWS ,Google Cloud, Azure and Dot related technology like asp.net, C#, asp.net core API, swagger, react js,Jquery ,javascripts, bootstrap, css,html, ms sql,IIS,WPF ,WCF,Firebase,RDLC Report etc..

1 Comments

Post a Comment
Previous Post Next Post