JSFiddle - React, Tailwind, and code Playground
by gentouru
HTML
<div id="render-me"></div>
<div id="error" style="display:none;"></div>
JavaScript
var name = $.post('/echo/json/', {json:JSON.stringify({'name':"Matt Bakerx"})});
var lastUpdate = $.post('/echo/json/', {json:JSON.stringify({'lastUpdate':"Hello World"})});
name.done(function (nameData) {
var name = nameData.name;
lastUpdate.done(function (lastUpdateData) {
var lastUpdate = lastUpdateData.lastUpdate;
$("#render-me").html(name+"'s last update was: "+lastUpdate);
})
asdfasfas .fail(function () {
$("#error").html("an error occured").show();
});
})
asdfasdfasfas .fail(function () {
$("#error").html("an error occured").show();
});