git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Centralize the logic for throwing exceptions. Fixes #5913.
[jquery.git]
/
src
/
ajax.js
diff --git
a/src/ajax.js
b/src/ajax.js
index
f1de0f8
..
502f006
100644
(file)
--- a/
src/ajax.js
+++ b/
src/ajax.js
@@
-578,7
+578,7
@@
jQuery.extend({
data = xml ? xhr.responseXML : xhr.responseText;
if ( xml && data.documentElement.nodeName === "parsererror" ) {
data = xml ? xhr.responseXML : xhr.responseText;
if ( xml && data.documentElement.nodeName === "parsererror" ) {
- throw "parsererror";
+ jQuery.error( "parsererror" );
}
// Allow a pre-filtering function to sanitize the response
}
// Allow a pre-filtering function to sanitize the response
@@
-606,7
+606,7
@@
jQuery.extend({
}
} else {
}
} else {
- throw "Invalid JSON: " + data;
+ jQuery.error( "Invalid JSON: " + data );
}
// If the type is "script", eval it in global context
}
// If the type is "script", eval it in global context