Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#dialog').bind('ajaxError', function(evt, request, error){
- responseText = eval('(' + request.responseText + ')');
- $("#dialog").clone().insertAfter('#dialog').attr('id', 'error-dialog');
- var viewLink = $(this);
- $("#error-dialog").dialog({
- resizable:false,
- width:440,
- height:400,
- modal: true,
- title: responseText.error.exception.title,
- overlay: {
- backgroundColor: '#000',
- opacity: 0.5
- },
- buttons: {
- 'Ok': function() {
- $(this).dialog('destroy');
- $(this).remove();
- }
- },
- open: function(event, ui) {
- errorBody = '<div>There was a fatal error during your request.<br /><br />';
- errorBody += '<div style="text-align:left;"><h3>Exception information:</h3><p><b>Message:</b><br />' + responseText.error.exception.message + '</p>';
- errorBody += ' <h3>Request Parameters:</h3><pre>' + responseText.error.request + '</pre></div></div>';
- $(this).html(errorBody);
- },
- close: function(event, ui) {
- $(this).dialog('destroy');
- $(this).remove();
- }
- });
- });
Add Comment
Please, Sign In to add comment