X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=27f81cc2450109187ae3094e7f7bd9475bed3796;hb=1912ded3ee0065a71ee0d16c1e5aaba0daef82a0;hp=ba316971553dafdf33307bb14cac87bd5f6f678e;hpb=292acd97a226ec15af2adc069d02973d59c6bc59;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index ba31697..27f81cc 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -261,7 +261,9 @@ jQuery.fn.extend({ } }); } else { - 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; } },