]> source.dussan.org Git - jquery.git/commitdiff
Use charAt instead of string indexing for oldIE's sake. Fixes #14356. 1366/head
authorTimmy Willison <timmywillisn@gmail.com>
Thu, 12 Sep 2013 20:49:15 +0000 (15:49 -0500)
committerTimmy Willison <timmywillisn@gmail.com>
Thu, 12 Sep 2013 20:49:53 +0000 (15:49 -0500)
src/ajax.js
test/unit/ajax.js

index cdd55a0a3252e1b5f6d7a277ddcde71d0d43983a..aa3bab34831e9497325134c5a69349d0a7da7527 100644 (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 );
 
index 152dabb4ae5d5a06837cb55e5ab652b11e914ec2..22fed363c8978579cba723f2c14604bb7d6b1d01 100644 (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();
                                }