TarafPerkahwinan WebAPI sample



    <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/TarafPerkahwinan",
            contentType: "application/json;charset=utf-8",
            dataType: "json",
            data: {},
            success: function (result) {
                    $('#tblTarafPerkahwinan').append('<thead><tr><th>Kod</th><th>Taraf Perkahwinan</th></tr></thead>')
                    $('#tblTarafPerkahwinan').append('<tbody>')
                    $.each(result, function (i) {
                        $('#tblTarafPerkahwinan').append('<tr><td>' + result[i].KodTarafPerkahwinan + '</td><td>' + result[i].NamaTarafPerkahwinan + '</td></tr>');
                    });
                    $('#tblTarafPerkahwinan').append('</tbody>')
            },
            failure: function () {
                alert("Error");
            }
        });
    });
    </script>
    <h2>Taraf Perkahwinan</h2>
    <div class="container">
        <div class="row">
            <div class="col-xs-10 col-sm-8 col-md-6 col-lg-4">
                <table id="tblTarafPerkahwinan" class="table well"></table>
            </div>
        </div>
    </div>