mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
bug 6158; fixing replaceWith from throwing errors on empty elements
This commit is contained in:
parent
2d0bc7ce72
commit
5c2d70979c
@ -261,6 +261,9 @@ jQuery.fn.extend({
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if ( !this.length ) {
|
||||
return this;
|
||||
}
|
||||
return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user