Commit ebd9205f authored by John Resig's avatar John Resig

Make sure that if no ownerDocument is available that we fall back to the node...

Make sure that if no ownerDocument is available that we fall back to the node itself (likely the document).
parent 122b672f
...@@ -475,11 +475,11 @@ jQuery.fn = jQuery.prototype = { ...@@ -475,11 +475,11 @@ jQuery.fn = jQuery.prototype = {
domManip: function( args, table, callback ) { domManip: function( args, table, callback ) {
if ( this[0] ) { if ( this[0] ) {
var fragment = this[0].ownerDocument.createDocumentFragment(), var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
scripts = jQuery.clean( args, this[0].ownerDocument, fragment ), scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),
first = fragment.firstChild, first = fragment.firstChild,
extra = this.length > 1 ? fragment.cloneNode(true) : fragment; extra = this.length > 1 ? fragment.cloneNode(true) : fragment;
if ( first ) if ( first )
for ( var i = 0, l = this.length; i < l; i++ ) for ( var i = 0, l = this.length; i < l; i++ )
callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment ); callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment );
......
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