Permalink
Browse files

Fixed cross domain jsonp requests not calling the error callback when…

… they fail.
  • Loading branch information...
1 parent 376e0d9 commit 68783a293161ce1848263a5be4b96b6f0d28fd9b @balupton committed Apr 11, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/ajax/script.js
View
@@ -51,6 +51,12 @@ jQuery.ajaxTransport( "script", function(s) {
script.src = s.url;
// Attach handlers for all browsers
+ script.onerror = function(){
+ // Trigger the error callback
+ if ( s.error ) {
+ s.error(null,'error',null);
+ }
+ };
script.onload = script.onreadystatechange = function( _, isAbort ) {
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {

0 comments on commit 68783a2

Please sign in to comment.