asked on
ASKER
$(document).ready(function() {
$.ajax({
type:'GET',
url: window.location.href, // OR the page you want to check for 404, 500 etc.
statusCode: {
500:function() {
alert('HTTP 500 Error has occurred.');
},
404:function() {
alert('HTTP 404 Error has occurred.');
},
200:function() {
// Everything was ok
location.reload(); // or redirect to another page
}
}
});
});
ASKER
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.
TRUSTED BY