JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/jquery-ui.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/themes/base/jquery-ui.css">
<div id="errorCode">
</div>
<div id="errorMessage">
</div>
JavaScript
$(document).load("/not-here.php", function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
$("#errorCode").html("Error Code: " + xhr.status);
$("#errorMessage").html("Error Message: " + xhr.statusText);
}
});