aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Aaron <brandon.aaron@gmail.com>2009-03-18 02:48:32 +0000
committerBrandon Aaron <brandon.aaron@gmail.com>2009-03-18 02:48:32 +0000
commitace13387c8d7b5823a580db0f1b2aafac515b9f5 (patch)
tree9d4aca0d03c366d52f34084446b12ef0c8d6a34f
parente73990a566fcb2dac71e1a25ec83382645adc5b7 (diff)
downloadjquery-ace13387c8d7b5823a580db0f1b2aafac515b9f5.tar.gz
jquery-ace13387c8d7b5823a580db0f1b2aafac515b9f5.zip
fix for #4074, pass context to jQuery.clean for jQuery.clone
-rw-r--r--src/core.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core.js b/src/core.js
index 271e7c434..56fbbde1c 100644
--- a/src/core.js
+++ b/src/core.js
@@ -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);
});