JSFiddle - React, Tailwind, and code Playground
by jdb1991
HTML
<button>Fire AJAX</button>
<div></div>
JavaScript
$(function () {
$("button").click(sendAjax);
});
function sendAjax() {
$(this).unbind("click", sendAjax);
$.ajax({
type: "POST",
url: "/echo/html/",
data: {
html: "<p>Hello, World!</p>",
delay: 3
}
}).done(function (response) {
$("div").append(response);
$("button").click(sendAjax);
});
};