});
function getAll( elem ) {
- if ( "getElementsByTagName" in elem ) {
+ if ( typeof elem.getElementsByTagName !== "undefined" ) {
return elem.getElementsByTagName( "*" );
- } else if ( "querySelectorAll" in elem ) {
+ } else if ( typeof elem.querySelectorAll !== "undefined" ) {
return elem.querySelectorAll( "*" );
} else {
}
// Finds all inputs and passes them to fixDefaultChecked
function findInputs( elem ) {
- if ( jQuery.nodeName( elem, "input" ) ) {
+ var nodeName = (elem.nodeName || "").toLowerCase();
+ if ( nodeName === "input" ) {
fixDefaultChecked( elem );
- } else if ( "getElementsByTagName" in elem ) {
+ // Skip scripts, get other children
+ } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
}
}
});
test("appendTo(String|Element|Array<Element>|jQuery)", function() {
- expect(16);
+ expect(17);
var defaultText = "Try them out:"
jQuery("<b>buga</b>").appendTo("#first");
jQuery("#moretests div:last").click();
QUnit.reset();
- var div = jQuery("<div/>").appendTo("#qunit-fixture, #moretests");
+ div = jQuery("<div/>").appendTo("#qunit-fixture, #moretests");
equals( div.length, 2, "appendTo returns the inserted elements" );
equals( jQuery("#qunit-fixture div").length, num, "Make sure all the removed divs were inserted." );
QUnit.reset();
+
+ stop();
+ jQuery.getScript('data/test.js', function() {
+ jQuery('script[src*="data\\/test\\.js"]').remove();
+ start();
+ });
});
var testPrepend = function(val) {