Skip to main content

Bug Tracker

Side navigation

#11420 closed bug (invalid)

Opened February 29, 2012 10:14AM UTC

Closed February 29, 2012 10:34AM UTC

Last modified February 29, 2012 12:50PM UTC

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

Reported by: turbo@minato.tv 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 )
Attachments (0)
Change History (3)

Changed February 29, 2012 10:21AM UTC by turbo@minato.tv comment:1

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] )

Changed February 29, 2012 10:34AM UTC by sindresorhus comment:2

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

Changed February 29, 2012 12:50PM UTC by turbo@minato.tv comment:3

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.