Skip to content
Permalink
Browse files

Make sure that if no ownerDocument is available that we fall back to …

…the node itself (likely the document).
  • Loading branch information
jeresig committed Jan 5, 2009
1 parent 122b672 commit ebd9205fdb7f14b98301c4c183e9d6a51420ad0e
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core.js
@@ -475,11 +475,11 @@ jQuery.fn = jQuery.prototype = {

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;

if ( first )
for ( var i = 0, l = this.length; i < l; i++ )
callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment );

0 comments on commit ebd9205

Please sign in to comment.
You can’t perform that action at this time.