Bug Tracker

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#11420 closed bug (invalid)

The usage of second argument of jQuery( html [ , ownerDocument ] )

Reported by: turbo@… Owned by:
Priority: low Milestone: None
Component: misc Version: 1.7.2b1
Keywords: Cc:
Blocked by: Blocking:

Description

I could not understand the usage of 'ownerDocument' of jQuery( html [ , ownerDocument ] ).

Recent document lists the following usage.

  • jQuery( selector [, context] )
  • jQuery( element [, context] )
  • jQuery( elementArray [, context] )
  • jQuery( html [, ownerDocument] )

I propose changing to the following usage.

  • jQuery( selector [, context] )
  • jQuery( element [, context] )
  • jQuery( elementArray [, context] )
  • jQuery( html )

Change History (3)

comment:1 Changed 8 years ago by turbo@…

The following may be better.


Recent document lists the following usage.

  • jQuery( selector [, context] )
  • jQuery( element [, context] )
  • jQuery( elementArray [, context] )
  • jQuery( html [, ownerDocument] )
  • jQuery( html [, prop] )

I propose changing to the following usage.

  • jQuery( selector [, context] )
  • jQuery( element [, context] )
  • jQuery( elementArray [, context] )
  • jQuery( html [, prop] )

comment:2 Changed 8 years ago by sindresorhus

Component: unfiledmisc
Priority: undecidedlow
Resolution: invalid
Status: newclosed

Thanks for taking the time to try to contribute to the jQuery project but this is not a valid bug. This bug tracker is not a support forum, and is only for solving reproducible, verifiable bugs with jQuery Core itself.

If you require assistance with your code, try asking in the forums, #jquery on Freenode, or on StackOverflow.

See the doc explanation:

ownerDocument: A document in which the new elements will be created

To answer your question, the ownerDocument is used when you want to create HTML elements in another document, like for example in an iframe.

MDN: https://developer.mozilla.org/en/DOM/Node.ownerDocument

comment:3 Changed 8 years ago by turbo@…

Thanks for answer.

But I think the ownerDocument is used at JQuery(element, ownerDocument) or jQuery(elementArray, ownerDocument), not at JQuery(html, ownerDocument).

So I propose to modify the jQuery function documentation.

Note: See TracTickets for help on using tickets.