1. $.ajax ({
  2.     type: 'POST',
  3.     url: '/reports/_report.php',
  4.     dataType: 'json',
  5.     data: filter,
  6.     global: false,
  7.     success: displayReport,
  8.     error: function ( request, errtype ) {
  9.         var e = arguments[2] || null;
  10.             
  11.         alert ( 'An error occurred while loading this report. ' e ? e.message : 'No additional information is available.' );
  12.         $( '#out-' report ).empty()
  13.             .append ( '<strong><em>Error</em></strong>' )
  14.             .attr ( 'title', e.message )
  15.             .css ( 'cursor', 'help' );
  16.     },
  17.     complete: function() {
  18.         $(indicator).css ( 'visibility', 'hidden' );
  19.         $(src).css ( 'opacity', '1' ).bind ( 'click', runReport );
  20.     }
  21. });