Keturunan 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/Keturunan",
            contentType: "application/json;charset=utf-8",
            dataType: "json",
            data: {},
            success: function (result) {
                $.each(result, function (i) {
                    $('#lstKeturunan').append('<li><a href="' + result[i].KodKeturunan + '-' + result[i].NamaKeturunan + '">' + result[i].NamaKeturunan + '</a></li>');
                });
            },
            failure: function () {
                alert("Error");
            }
        });
    });
    </script>
    <h2>Keturunan</h2>
    <div class="dropdown">
        <button class="btn dropdown-toggle" type="button" id="menu1" data-toggle="dropdown">
            Keturunan
            <span class="caret"></span>
        </button>
        <ul id="lstKeturunan" class="dropdown-menu" role="menu"></ul>
    </div>