X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmanipulation.js;h=d5523dd79c6f9c92ca7854b9fff3efea104e2a6a;hb=aa81bb5e458efd25981933c339ac1a0090e6eb0f;hp=baab8c6c0e5940e9fd645ffd19e35d2e5e242bd9;hpb=da51cd0e43d6d61e0d3d6c197cef1e658bad29bc;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index baab8c6..d5523dd 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -32,11 +32,11 @@ if ( !jQuery.support.htmlSerialize ) { jQuery.fn.extend({ text: function( text ) { - if(jQuery.isFunction(text)) { - return this.each(function() { - return jQuery(this).text( text.call(this) ); - }); - } + if(jQuery.isFunction(text)) { + return this.each(function() { + return jQuery(this).text( text.call(this) ); + }); + } if ( typeof text !== "object" && text !== undefined ) { return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); @@ -279,7 +279,7 @@ function cloneCopyEvent(orig, ret) { var i = 0; ret.each(function(){ - if ( this.nodeName !== orig[i].nodeName ) { + if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) { return; }