JSFiddle - React, Tailwind, and code Playground
HTML
<body>
</body>
JavaScript
function getLeft() {
var result;
$.ajax('/echo/json', {
async: false,
success: function (data) {
console.log(data);
result = data;
}
});
return result;
}
console.log(JSON.stringify(getLeft()));
$('body').append($('<div></div>').text(JSON.stringify(getLeft())));