Guest User

Untitled

a guest
Jul 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. $('#dialog').bind('ajaxError', function(evt, request, error){
  2. responseText = eval('(' + request.responseText + ')');
  3. $("#dialog").clone().insertAfter('#dialog').attr('id', 'error-dialog');
  4.  
  5. var viewLink = $(this);
  6.  
  7. $("#error-dialog").dialog({
  8. resizable:false,
  9. width:440,
  10. height:400,
  11. modal: true,
  12. title: responseText.error.exception.title,
  13. overlay: {
  14. backgroundColor: '#000',
  15. opacity: 0.5
  16. },
  17. buttons: {
  18. 'Ok': function() {
  19. $(this).dialog('destroy');
  20. $(this).remove();
  21. }
  22. },
  23. open: function(event, ui) {
  24. errorBody = '<div>There was a fatal error during your request.<br /><br />';
  25. errorBody += '<div style="text-align:left;"><h3>Exception information:</h3><p><b>Message:</b><br />' + responseText.error.exception.message + '</p>';
  26. errorBody += ' <h3>Request Parameters:</h3><pre>' + responseText.error.request + '</pre></div></div>';
  27.  
  28. $(this).html(errorBody);
  29. },
  30. close: function(event, ui) {
  31. $(this).dialog('destroy');
  32. $(this).remove();
  33. }
  34. });
  35. });
Add Comment
Please, Sign In to add comment