bug 6158; fixing replaceWith from throwing errors on non existant elements
This commit is contained in:
parent
5c2d70979c
commit
c9ef09c800
2 changed files with 8 additions and 6 deletions
|
@ -261,10 +261,9 @@ jQuery.fn.extend({
|
|||
}
|
||||
});
|
||||
} else {
|
||||
if ( !this.length ) {
|
||||
return this;
|
||||
}
|
||||
return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
|
||||
return ( this.length ) ?
|
||||
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
|
||||
this;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue