mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Make sure that if no ownerDocument is available that we fall back to the node itself (likely the document).
This commit is contained in:
parent
122b672f70
commit
ebd9205fdb
@ -475,8 +475,8 @@ 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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user