mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fixed problem with $("div",$("body")) breaking (returning an array, of length one, containing undefined).
This commit is contained in:
parent
0798c6e64e
commit
33662cd713
2
src/jquery/jquery.js
vendored
2
src/jquery/jquery.js
vendored
@ -1579,7 +1579,7 @@ jQuery.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var r = [ result[0] ];
|
var r = result.length ? [ result[0] ] : [];
|
||||||
|
|
||||||
check: for ( var i = 1, rl = result.length; i < rl; i++ ) {
|
check: for ( var i = 1, rl = result.length; i < rl; i++ ) {
|
||||||
for ( var j = 0; j < i; j++ )
|
for ( var j = 0; j < i; j++ )
|
||||||
|
@ -101,7 +101,7 @@ jQuery.extend({
|
|||||||
return [ t ];
|
return [ t ];
|
||||||
|
|
||||||
// Make sure that the context is a DOM Element
|
// Make sure that the context is a DOM Element
|
||||||
if ( context && context.nodeType == undefined )
|
if ( context && !context.nodeType )
|
||||||
context = null;
|
context = null;
|
||||||
|
|
||||||
// Set the correct context (if none is provided)
|
// Set the correct context (if none is provided)
|
||||||
|
Loading…
Reference in New Issue
Block a user