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
}
} else {
- throw "Invalid JSON: " + data;
+ jQuery.error( "Invalid JSON: " + data );
}
// If the type is "script", eval it in global context
if ( set ) {
// We can't allow the type property to be changed (since it causes problems in IE)
if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
- throw "type property can't be changed";
+ jQuery.error( "type property can't be changed" );
}
elem[ name ] = value;