Agama WebAPI sample

Kod Agama


    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css" rel="stylesheet" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
    <script>
    $(document).ready(function () {
        $.ajax({
            type: "get",
            url: "http://www.azali.net/API/Agama",
            contentType: "application/json;charset=utf-8",
            dataType: "json",
            data: {},
            success: function (result) {
                    $.each(result, function (i) {
                        $('#tblAgama').append('<tr><td>' + result[i].KodAgama + '</td><td>' + result[i].NamaAgama + '</td></tr>');
                    });
            },
            failure: function () {
                alert("Error");
            }
        });
    });
    </script>
    <h2>Agama</h2>
    <table class="table well">
        <thead> 
            <tr>
                <th>Kod</th>
                <th>Agama</th>
            </tr>
        </thead>
        <tbody id="tblAgama">
        </tbody>
    </table>