JSFiddle - React, Tailwind, and code Playground

by john_s

HTML

<button type="button" id="go">go!</button>
<div>
    <table id="results">
        <tbody id="resultbody">
            <tr>
                <th>Col1</th>
                <th>Col2</th>
            </tr>
        </tbody>
    </table>
</div>

JavaScript

function dosomething(miliseconds) {
    var currentTime = new Date().getTime();
    while (currentTime + miliseconds >= new Date().getTime()) {}
}

$(document).ready(function () {
    $("#go").click(function () {
        for (var i = 0; i < 10; i++) {
            $.ajax('/echo/html', {
                async: false,
                type: 'post',
                dataType: 'html',
                data: {
                    html: 'test',
                    delay: 0.5
                },
                success: function (html) {
                    $('#resultbody').append('<tr><td>' + i + ' Hello</td><td>World</td>');
                }
            });
        }
    });
});