bug 6158; fixing replaceWith from throwing errors on empty elements

This commit is contained in:
Jordan Boesch 2011-03-05 09:30:29 -06:00
parent 2d0bc7ce72
commit 5c2d70979c

View file

@ -261,6 +261,9 @@ jQuery.fn.extend({
}
});
} else {
if ( !this.length ) {
return this;
}
return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
}
},