X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=59973deee8ba546bd1612eab9a471f38b61da690;hb=7d7a960035b7431887581c9cef09eaaef28e3d27;hp=233cb826360af47068da204db86673d2d42d043a;hpb=e8eff25f3b6d9a0c03f6581089406cebcc86aa34;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 233cb82..59973de 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -138,6 +138,14 @@ jQuery.fn.extend({ domManip: function( args, table, callback ) { var fragment, scripts, cacheable, cached, cacheresults, first; + var value = args[0]; + + if ( jQuery.isFunction(value) ) { + return this.each(function() { + args[0] = value.call(this); + return jQuery(this).domManip( args, table, callback ); + }); + }; if ( this[0] ) { if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && args[0].indexOf("