sp-codes.de/bower_components/jquery/src/manipulation/getAll.js

32 lines
626 B
JavaScript
Raw Normal View History

2016-10-28 17:33:25 +00:00
define( [
"../core"
], function( jQuery ) {
2016-11-22 23:07:57 +00:00
"use strict";
2016-10-28 17:33:25 +00:00
function getAll( context, tag ) {
2016-11-22 23:07:57 +00:00
// Support: IE <=9 - 11 only
2016-10-28 17:33:25 +00:00
// Use typeof to avoid zero-argument method invocation on host objects (#15151)
2016-11-22 23:07:57 +00:00
var ret;
if ( typeof context.getElementsByTagName !== "undefined" ) {
ret = context.getElementsByTagName( tag || "*" );
} else if ( typeof context.querySelectorAll !== "undefined" ) {
ret = context.querySelectorAll( tag || "*" );
} else {
ret = [];
}
if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {
return jQuery.merge( [ context ], ret );
}
return ret;
2016-10-28 17:33:25 +00:00
}
return getAll;
} );