$('*').ajaxError(function (event, request, settings) { if (request.status == 404) { $('#dialog').html('A remote endpoint was not found.'); } else if (request.status == 500) { $('#dialog').html('An 500 Internal Server error occured when trying to load a remote endpoint.'); } else { $('#dialog').html('An unknown error was encountered loading a remote endpoint.
Error Code: '+request.status); } $('#dialog').append('

Requested Page: '+settings.url); $('#dialog').dialog({buttons: {Close: function() {$(this).dialog('destroy');}}, title: 'Load Error', dialogClass: 'ui-state-error'}); }); function loadMsg(str) { return "


"+str+"
"; } $.validator.setDefaults({errorClass: "ui-state-error"});