Commit ace13387 authored by Brandon Aaron's avatar Brandon Aaron

fix for #4074, pass context to jQuery.clean for jQuery.clone

parent e73990a5
......@@ -333,14 +333,14 @@ jQuery.fn = jQuery.prototype = {
// attributes in IE that are actually only stored
// as properties will not be copied (such as the
// the name attribute on an input).
var html = this.outerHTML;
var html = this.outerHTML, ownerDocument = this.ownerDocument;
if ( !html ) {
var div = this.ownerDocument.createElement("div");
var div = ownerDocument.createElement("div");
div.appendChild( this.cloneNode(true) );
html = div.innerHTML;
}
return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0];
return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")], ownerDocument)[0];
} else
return this.cloneNode(true);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment