JSFiddle - React, Tailwind, and code Playground
JavaScript
$.ajax({
url:'doesnotexist.php',
data:'lots of data from 200KB to 5MB',
type:'post',
success: function(data)
{
alert('Success');
//some stuff on success
},
error: function(XMLHttpRequest, textStatus, errorThrown)
{
alert(JSON.stringify(errorThrown));
//some stuff on failure
}
});