Bug Tracker

Ticket #3235: 3235.diff

File 3235.diff, 0.7 kB (added by nathanhammond, 5 months ago)

Better Patch.

  • jquery/src/ajax.js

     
    283283 
    284284        // Open the socket 
    285285        // Passing null username, generates a login popup on Opera (#2865) 
    286         if( s.username ) 
    287             xhr.open(type, s.url, s.async, s.username, s.password); 
    288         else 
    289             xhr.open(type, s.url, s.async); 
    290286 
     287        try { 
     288            if( s.username ) 
     289                xhr.open(type, s.url, s.async, s.username, s.password); 
     290            else 
     291                xhr.open(type, s.url, s.async); 
     292        } catch (e) { 
     293            return jQuery.handleError(s, xhr, "error", e); 
     294        } 
     295 
    291296        // Need an extra try/catch for cross domain requests in Firefox 3 
    292297        try { 
    293298            // Set the correct header, if data is being sent