JSFiddle - React, Tailwind, and code Playground
by Ignacio Fuentes
HTML
<script src="https://raw.github.com/appendto/jquery-mockjax/master/jquery.mockjax.js"></script>
JavaScript
// use mockjax to define some fake json request url's and data
$.mockjax({
url: '/test',
status: 404,
statusText: "á",
});
$.ajax({
dataType: 'JSON',
contentType: 'application/json; charset=utf-8',
type: "POST",
url: "/test",
context: document.body,
data: "test",
success: function (data) {
alert(data);
},
error: function (e) {
alert(e.statusText);
}
});