bug 6158; fixing replaceWith from throwing errors on empty elements
This commit is contained in:
parent
2d0bc7ce72
commit
5c2d70979c
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue