git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
e73990a
)
fix for #4074, pass context to jQuery.clean for jQuery.clone
author
Brandon Aaron
<brandon.aaron@gmail.com>
Wed, 18 Mar 2009 02:48:32 +0000
(
02:48
+0000)
committer
Brandon Aaron
<brandon.aaron@gmail.com>
Wed, 18 Mar 2009 02:48:32 +0000
(
02:48
+0000)
src/core.js
patch
|
blob
|
history
diff --git
a/src/core.js
b/src/core.js
index
271e7c4
..
56fbbde
100644
(file)
--- 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).
// 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 ) {
if ( !html ) {
- var div = this.ownerDocument.createElement("div");
+ var div = ownerDocument.createElement("div");
div.appendChild( this.cloneNode(true) );
html = div.innerHTML;
}
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);
});
} else
return this.cloneNode(true);
});