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:
122b672
)
Make sure that if no ownerDocument is available that we fall back to the node itself...
author
John Resig
<jeresig@gmail.com>
Mon, 5 Jan 2009 19:22:25 +0000
(19:22 +0000)
committer
John Resig
<jeresig@gmail.com>
Mon, 5 Jan 2009 19:22:25 +0000
(19:22 +0000)
src/core.js
patch
|
blob
|
history
diff --git
a/src/core.js
b/src/core.js
index
d779061
..
9222e0a
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-475,11
+475,11
@@
jQuery.fn = jQuery.prototype = {
domManip: function( args, table, callback ) {
if ( this[0] ) {
domManip: function( args, table, callback ) {
if ( this[0] ) {
- var fragment = this[0].ownerDocument.createDocumentFragment(),
- scripts = jQuery.clean( args, this[0].ownerDocument, fragment ),
+ var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
+ scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),
first = fragment.firstChild,
extra = this.length > 1 ? fragment.cloneNode(true) : fragment;
first = fragment.firstChild,
extra = this.length > 1 ? fragment.cloneNode(true) : fragment;
-
+
if ( first )
for ( var i = 0, l = this.length; i < l; i++ )
callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment );
if ( first )
for ( var i = 0, l = this.length; i < l; i++ )
callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment );