X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=10db3edafc674327750eb9bc7c1678577af80562;hb=50c40add5ab530cefbdd09dbdcb641f22b9dc26c;hp=33e109b92e598df0ce49c15a484a4401e2921a24;hpb=b32ec31d896eb163c5f3d9b54ca9da3c0dd90ce0;p=jquery.git diff --git a/src/core.js b/src/core.js index 33e109b..10db3ed 100644 --- a/src/core.js +++ b/src/core.js @@ -323,6 +323,8 @@ jQuery.fn = jQuery.prototype = { // Copy the events from the original to the clone if ( events === true ) this.find("*").andSelf().each(function(i){ + if (this.nodeType == 3) + return; var events = jQuery.data( this, "events" ); for ( var type in events ) @@ -498,7 +500,7 @@ jQuery.fn = jQuery.prototype = { jQuery.each(elems, function(){ var elem = clone ? - this.cloneNode( true ) : + jQuery( this ).clone( true )[0] : this; // execute all scripts after the elements have been injected