JSFiddle - React, Tailwind, and code Playground
by ajuhos
HTML
<script src="http://cloud.github.com/downloads/ajuhos/sharpnr.js/sharpnr-1.0-beta.js"></script>
<div id="test"></div>
JavaScript
var getAsync = async(function(url) {
$("#test").text("Loading...");
var result = await;
$.post(url, {
html: "<h1>SUCCESS!</h1>",
delay: 3
});
$("#test").text("Preparing content...");
if (result) {
for (var i = 1; i <= 10; i++) {
await;
window.setTimeout($$, 300);
$("#test").text("Preparing content... " + i * 10 + "%");
}
$("#test").html(result);
}
else {
$("#test").text("Error :(");
}
});
$(function() {
getAsync("/echo/html/");
});