mirror of
https://github.com/jquery/jquery.git
synced 2026-02-09 07:55:10 -05:00
Core: Standardize indexOf comparisons
not present: `< 0` present: `> -1` at index: `=== N` Closes gh-1984
This commit is contained in:
@@ -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"
|
||||
);
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user