- // Checkers
- // 1) key is dataType
- // 2) they are called to control successful response
- // 3) error throws is used as error data
- dataCheckers: {
-
- // Check if data is a string
- "text": function(data) {
- if ( typeof data != "string" ) {
- jQuery.error("typeerror");
- }
- },
-
- // Check if xml has been properly parsed
- "xml": function(data) {
- var documentElement = data ? data.documentElement : data;
- if ( ! documentElement || ! documentElement.nodeName ) {
- jQuery.error("typeerror");
- }
- if ( documentElement.nodeName == "parsererror" ) {
- jQuery.error("parsererror");
- }
- }
- },
-