X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=2b856c8dda439c1bb424cea5bdfb988acffcfbaf;hb=9bcd2b370b4aa72cc60af85d0f8a0872d0d17a0a;hp=33e109b92e598df0ce49c15a484a4401e2921a24;hpb=b32ec31d896eb163c5f3d9b54ca9da3c0dd90ce0;p=jquery.git diff --git a/src/core.js b/src/core.js index 33e109b..2b856c8 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 @@ -597,8 +599,7 @@ jQuery.extend({ return jQuery; }, - // This may seem like some crazy code, but trust me when I say that this - // is the only cross-browser way to do this. --John + // See test/unit/core.js for details concerning this function. isFunction: function( fn ) { return !!fn && typeof fn != "string" && !fn.nodeName && fn.constructor != Array && /function/i.test( fn + "" ); @@ -932,7 +933,7 @@ jQuery.extend({ if ( typeof elem == "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ - return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i) ? + return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? all : front + ">"; });