JSFiddle - React, Tailwind, and code Playground

by Corey Frang

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">

CSS

div { font-family: monospace; padding: 5px; }

JavaScript

(function() {
    // create a scope for us to store the data:
    var data = {
        id: 1
    };
    $.ajax({
        url: '/something-to-genereate-error',
        data: data,
        error: function() {
            if (window.console && console.log) console.log(this, data);
            $("body").append("This:", $("<div>").text(JSON.stringify(this)), "data:", $("<div>").text(JSON.stringify(data)));
        }
    });
})(); // call the function immediatey