@@ 6931-6968 (lines=38) @@ | ||
6928 | } |
|
6929 | ||
6930 | // Base inspection function for prefilters and transports |
|
6931 | function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR, |
|
6932 | dataType /* internal */, inspected /* internal */ ) { |
|
6933 | ||
6934 | dataType = dataType || options.dataTypes[ 0 ]; |
|
6935 | inspected = inspected || {}; |
|
6936 | ||
6937 | inspected[ dataType ] = true; |
|
6938 | ||
6939 | var list = structure[ dataType ], |
|
6940 | i = 0, |
|
6941 | length = list ? list.length : 0, |
|
6942 | executeOnly = ( structure === prefilters ), |
|
6943 | selection; |
|
6944 | ||
6945 | for ( ; i < length && ( executeOnly || !selection ); i++ ) { |
|
6946 | selection = list[ i ]( options, originalOptions, jqXHR ); |
|
6947 | // If we got redirected to another dataType |
|
6948 | // we try there if executing only and not done already |
|
6949 | if ( typeof selection === "string" ) { |
|
6950 | if ( !executeOnly || inspected[ selection ] ) { |
|
6951 | selection = undefined; |
|
6952 | } else { |
|
6953 | options.dataTypes.unshift( selection ); |
|
6954 | selection = inspectPrefiltersOrTransports( |
|
6955 | structure, options, originalOptions, jqXHR, selection, inspected ); |
|
6956 | } |
|
6957 | } |
|
6958 | } |
|
6959 | // If we're only executing or nothing was selected |
|
6960 | // we try the catchall dataType if not done already |
|
6961 | if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { |
|
6962 | selection = inspectPrefiltersOrTransports( |
|
6963 | structure, options, originalOptions, jqXHR, "*", inspected ); |
|
6964 | } |
|
6965 | // unnecessary when only executing (prefilters) |
|
6966 | // but it'll be ignored by the caller in that case |
|
6967 | return selection; |
|
6968 | } |
|
6969 | ||
6970 | // A special extend for ajax options |
|
6971 | // that takes "flat" options (not to be deep extended) |
@@ 6060-6097 (lines=38) @@ | ||
6057 | } |
|
6058 | ||
6059 | //Base inspection function for prefilters and transports |
|
6060 | function inspectPrefiltersOrTransports( structure, options, originalOptions, jXHR, |
|
6061 | dataType /* internal */, inspected /* internal */ ) { |
|
6062 | ||
6063 | dataType = dataType || options.dataTypes[ 0 ]; |
|
6064 | inspected = inspected || {}; |
|
6065 | ||
6066 | inspected[ dataType ] = true; |
|
6067 | ||
6068 | var list = structure[ dataType ], |
|
6069 | i = 0, |
|
6070 | length = list ? list.length : 0, |
|
6071 | executeOnly = ( structure === prefilters ), |
|
6072 | selection; |
|
6073 | ||
6074 | for(; i < length && ( executeOnly || !selection ); i++ ) { |
|
6075 | selection = list[ i ]( options, originalOptions, jXHR ); |
|
6076 | // If we got redirected to another dataType |
|
6077 | // we try there if not done already |
|
6078 | if ( typeof selection === "string" ) { |
|
6079 | if ( inspected[ selection ] ) { |
|
6080 | selection = undefined; |
|
6081 | } else { |
|
6082 | options.dataTypes.unshift( selection ); |
|
6083 | selection = inspectPrefiltersOrTransports( |
|
6084 | structure, options, originalOptions, jXHR, selection, inspected ); |
|
6085 | } |
|
6086 | } |
|
6087 | } |
|
6088 | // If we're only executing or nothing was selected |
|
6089 | // we try the catchall dataType if not done already |
|
6090 | if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) { |
|
6091 | selection = inspectPrefiltersOrTransports( |
|
6092 | structure, options, originalOptions, jXHR, "*", inspected ); |
|
6093 | } |
|
6094 | // unnecessary when only executing (prefilters) |
|
6095 | // but it'll be ignored by the caller in that case |
|
6096 | return selection; |
|
6097 | } |
|
6098 | ||
6099 | jQuery.fn.extend({ |
|
6100 | load: function( url, params, callback ) { |