<?php
if (isset($_POST['marka'])) {
    header('Content-type: application/json');
    // get_contents kodları burada yer alacak, çekilecek sayfadaki yapılacak işlemler

    exit(json_encode(array('status' => true)));
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <style type="text/css">
        ul {
            font-family: Verdana;
            margin: 0;
            padding: 35px;
            list-style: none;
        }

        ul li.xhr {

        }

        ul li.ok {
            color: green;
            font-weight: bold;
        }

        ul li.ok:after {
            content: "~ Successfully";
            opacity: .5;
            margin-left: 5px;
        }

        ul li.fail {
            color: red;
            font-weight: bold;
        }

        ul li.fail:after {
            content: "~ Fail";
            opacity: .5;
            margin-left: 5px;
        }
    </style>
</head>
<body>
    
    <ul>
        
    </ul>

<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
<script>
    let markalist = [
        {marka: "iphone"},
        {marka: "lg"},
        {marka: "QuarkChain"}
    ];

    $.each(markalist, function(index, item){
        $("ul").append($("<li>").data("marka", item.marka).text(item.marka));
    });

    let get_brand = function(){
        let li = $("ul li:not(.xhr)").first();

        if ( ! li.length) return;

        $.ajax({
            url: "",
            type: "POST",
            dataType: "JSON",
            data: {marka: li.data("marka")},
            success: function(json){
                li.addClass("xhr");

                if (json.status) {
                    li.addClass("ok");
                } else {
                    li.addClass("fail");
                }
                
                get_brand();
            }
        });
    }

    get_brand();
</script>
</body>
</html>