Use charAt instead of string indexing for oldIE's sake. Fixes #14356.

This commit is contained in:
Timmy Willison 2013-09-12 15:49:15 -05:00
parent c6b4230d5c
commit 53aa2e0c8b
2 changed files with 3 additions and 2 deletions

View File

@ -78,7 +78,7 @@ function addToPrefiltersOrTransports( structure ) {
// For each dataType in the dataTypeExpression
while ( (dataType = dataTypes[i++]) ) {
// Prepend if requested
if ( dataType[0] === "+" ) {
if ( dataType.charAt( 0 ) === "+" ) {
dataType = dataType.slice( 1 ) || "*";
(structure[ dataType ] = structure[ dataType ] || []).unshift( func );

View File

@ -1568,9 +1568,10 @@ module( "ajax", {
//----------- jQuery.ajaxPrefilter()
ajaxTest( "jQuery.ajaxPrefilter() - abort", 1, {
dataType: "prefix",
setup: function() {
// Ensure prefix does not throw an error
jQuery.ajaxPrefilter("+prefix *", function( options, _, jqXHR ) {
jQuery.ajaxPrefilter("+prefix", function( options, _, jqXHR ) {
if ( options.abortInPrefilter ) {
jqXHR.abort();
}