JSFiddle - React, Tailwind, and code Playground

by mblase75

HTML

<div id="myDiv"></div>

CSS

#myDiv {
    height: 100px;
}

JavaScript

$(document).ready(function() {
    sendData();

    function sendData() {
        $.ajax({
            type: "POST",
            data: {
                json: '{"d":"123"}'
            },
            url: "/echo/json/",
            //contentType: "application/json; charset=utf-8",
            dataType: "json",
            //async: "true",
            //cache: "false",
            success: function(msg) {
                alert(msg.d);
                $("#myDiv").append(msg.d);
            },

            error: function(x, e) {
                alert("Some error");
            }

        });

    }

});