Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix for #4074, pass context to jQuery.clean for jQuery.clone
  • Loading branch information
brandonaaron committed Mar 18, 2009
1 parent e73990a commit ace1338
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core.js
Expand Up @@ -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);
});
Expand Down

0 comments on commit ace1338

Please sign in to comment.