diff options
author | Jordan Boesch <jboesch26@gmail.com> | 2011-03-05 09:30:29 -0600 |
---|---|---|
committer | Jordan Boesch <jboesch26@gmail.com> | 2011-03-05 09:30:29 -0600 |
commit | 5c2d70979c15bbda5c90e1634abe11d8c350abcb (patch) | |
tree | 359c20165a1ad8304a500a04fd961ff1b9d9828f | |
parent | 2d0bc7ce72ab8d64da0506a88c8cc543ce3ceaba (diff) | |
download | jquery-5c2d70979c15bbda5c90e1634abe11d8c350abcb.tar.gz jquery-5c2d70979c15bbda5c90e1634abe11d8c350abcb.zip |
bug 6158; fixing replaceWith from throwing errors on empty elements
-rw-r--r-- | src/manipulation.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index ba3169715..a4a81de44 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -261,6 +261,9 @@ jQuery.fn.extend({ } }); } else { + if ( !this.length ) { + return this; + } return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ); } }, |