diff --git a/public/js/custom.js b/public/js/custom.js index 38ae6ef..5bc66b1 100644 --- a/public/js/custom.js +++ b/public/js/custom.js @@ -42,8 +42,21 @@ $(document).ready(function() { }).done(function(html) { $('.main-content').empty().append(html); - }).fail(function() { - alert('Failed'); + }).fail(function(item) { + switch(item.status) { + case 404: + $('.main-content').empty().append(item.responseText); + break; + case 419: + alert('Session has expired, reloading the page and try again...'); + location.reload(); + break; + case 500: + $('.main-content').empty().append(item.responseText); + break; + default: + alert(item.status+': Well that didnt work?'); + } }); } }, diff --git a/resources/themes/architect/views/layouts/partials/sidebarmenu.blade.php b/resources/themes/architect/views/layouts/partials/sidebarmenu.blade.php index c20b0cc..97f2f8d 100644 --- a/resources/themes/architect/views/layouts/partials/sidebarmenu.blade.php +++ b/resources/themes/architect/views/layouts/partials/sidebarmenu.blade.php @@ -80,7 +80,7 @@ $('.main-content').empty().append(html); }).fail(function() { - //alert('Failed'); + alert('Well that didnt work?'); }); e.stopPropagation();