JSFiddle - React, Tailwind, and code Playground
JavaScript
function getMonster (){
var theMonster = $.ajax({
url : "http://codepen.io/chriscoyier/pen/difoC.html",
success : function(data){
console.log("Monster Succeeded inside 'success' block");
}
});
return theMonster;
}
var theMonster = getMonster();
theMonster.then (function(){
console.log("Moster Succeeded outside");
}, function(){
console.log("Monster Failed :(");
});