X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=8c188c2d565e83f853450f5ade778a6e20fa9ca2;hb=0b3165fd23ba4d240dd72f93d315bb5f7bf970e8;hp=37a8cfdfe038b327e43958e36a327f7ca6199813;hpb=9f17e70ae95cc2d4b945bc94283b87cc5b8b23db;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 37a8cfd..8c188c2 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -233,6 +233,12 @@ jQuery.fn.extend({ // this can help fix replacing a parent with child elements if ( !jQuery.isFunction( value ) ) { value = jQuery( value ).detach(); + + } else { + return this.each(function(i) { + var self = jQuery(this), old = self.html(); + self.replaceWith( value.call( this, i, old ) ); + }); } return this.each(function() {