diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2014-12-31 18:31:27 -0500 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2015-01-10 23:47:01 -0500 |
commit | 53aa87f3bf4284763405f3eb8affff296e55ba4f (patch) | |
tree | aa6731b18465d87fbd0f1b93a33cdb1e59a5d04e /src/ajax | |
parent | 4cbf02df84dbcaa44b75a64ed832f7dbff2231dd (diff) | |
download | jquery-53aa87f3bf4284763405f3eb8affff296e55ba4f.tar.gz jquery-53aa87f3bf4284763405f3eb8affff296e55ba4f.zip |
Core: Standardize indexOf comparisons
not present: `< 0`
present: `> -1`
at index: `=== N`
Closes gh-1984
Diffstat (limited to 'src/ajax')
-rw-r--r-- | src/ajax/jsonp.js | 3 | ||||
-rw-r--r-- | src/ajax/load.js | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/ajax/jsonp.js b/src/ajax/jsonp.js index d7ca7e1a7..a04898f67 100644 --- a/src/ajax/jsonp.js +++ b/src/ajax/jsonp.js @@ -25,7 +25,8 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && - !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && + ( s.contentType || "" ) + .indexOf("application/x-www-form-urlencoded") === 0 && rjsonp.test( s.data ) && "data" ); diff --git a/src/ajax/load.js b/src/ajax/load.js index bff25b1a4..2d56b704b 100644 --- a/src/ajax/load.js +++ b/src/ajax/load.js @@ -24,7 +24,7 @@ jQuery.fn.load = function( url, params, callback ) { self = this, off = url.indexOf(" "); - if ( off >= 0 ) { + if ( off > -1 ) { selector = jQuery.trim( url.slice( off ) ); url = url.slice( 0, off ); } |