Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2 from rlidwka/ajax-error

Added error handling option.
  • Loading branch information...
commit 59b6a6ae65ec285b5b3cd829bce72b60c08a9a1d 2 parents e9c0dcb + e68e975
@artzstudio authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/jquery.amd.js
View
5 src/jquery.amd.js
@@ -32,6 +32,7 @@
basePath: "",
filename: function(str){ return str.toLowerCase(); },
suffix: ".min.js"
+ onerror: function(err){ throw err; }
};
$.define = function( moduleName, moduleDependencies, moduleDefinition ) {
@@ -202,6 +203,10 @@
dataType: "script",
cache: true,
complete: defineModule
+ error: function(jqXHR, textStatus, errorThrown) {
+ if (!errorThrown) errorThrown = new Error('Error loading "' + moduleName +'": ' + textStatus);
+ options.onerror(errorThrown);
+ }
});
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.