diff options
Diffstat (limited to 'src/manipulation.js')
-rw-r--r-- | src/manipulation.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index ba3169715..758cdbae0 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; } }, @@ -375,7 +377,7 @@ function cloneCopyEvent( src, dest ) { } } -function cloneFixAttributes(src, dest) { +function cloneFixAttributes( src, dest ) { // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; @@ -547,7 +549,8 @@ jQuery.extend({ // Return the cloned set return clone; -}, + }, + clean: function( elems, context, fragment, scripts ) { context = context || document; |