Skip to main content

Bug Tracker

Side navigation

#4018 closed bug (fixed)

Opened January 28, 2009 11:12PM UTC

Closed January 29, 2010 03:14AM UTC

Last modified March 14, 2012 12:19PM UTC

documentation incorrect for jQuery.support.tbody

Reported by: timc Owned by:
Priority: minor Milestone: 1.3.2
Component: docs Version: 1.3.1
Keywords: support Cc:
Blocked by: Blocking:
Description

currently at

http://docs.jquery.com/Utilities/jQuery.support

it says:

# tbody: Is equal to true if the browser allows table elements without tbody elements (is currently false in IE, which automatically inserts tbody if it is not present).

However, that seems backwards -- on my ff3.0

>>> $.support.tbody

true

thanks

Attachments (0)
Change History (7)

Changed January 28, 2009 11:58PM UTC by dmethvin comment:1

What makes you think that $.support.tbody==true is incorrect for Firefox 3.0?

Changed January 29, 2009 03:27AM UTC by timc comment:2

the behavior is correct, but i think documentation is incorrect or at least confusing:

# tbody: Is equal to true if the browser allows table elements without tbody elements (is currently false in IE, which automatically inserts tbody if it is not present).

ff does not "allow" table elts w/o tbody in the sense that $('table > tr') will not return a result; it is ff that "automatically inserts tbody" -- i don't believe IE does, although i have not checked on all IE versions.

Thanks!

Changed January 30, 2009 01:21AM UTC by dmethvin comment:3

Ah, okay. IE does indeed insert tbody tags in several cases where most other browsers do not. For example, take an HTML document with

<table></table>
in it and get the resulting
.innerHTML
to see what I mean.

jQuery needs to know this so that when it handles

$("htmlstring")
cases, it can fix cases where IE goes all tbody-happy on the resulting DOM. This is actually a pretty obscure thing and I doubt that any code outside jQuery itself would need to use the feature detection, so it's probably not too critical to explain it in a lot of detail.

Changed May 10, 2009 03:41AM UTC by dmethvin comment:4

resolution: → fixed
status: newclosed

Updated documentation for

jQuery.support
to clarify this.

Changed January 25, 2010 09:58AM UTC by mcm comment:5

resolution: fixed
status: closedreopened

I still found the documentation on $.support.tbody very confusing until I found this, can:

"Is equal to true if a <table> element can exist without a <tbody> element"

Be changed to something like:

"Is equal to true if an empty <table> tag can exist without a <tbody> element"

Changed January 25, 2010 10:31AM UTC by mcm comment:6

Just to clarify, now that I know what this property represents it's not of use to me as you suggested. In my script I needed to account for the presence of the tbody element (i.e. <table><tr></tr></table>) and wasn't sure if all browsers inserted it in this case or not so used some javascript to test it in case. However, I later found this property in the docs and thought I could tidy up my code a bit by using it instead but found it was wrong.

So hopefully by changing the docs to allude to one of the situations where non-IE browsers don't insert tbody I would have tested this and then realised this property doesn't apply to me.

Changed January 29, 2010 03:14AM UTC by dmethvin comment:7

resolution: → fixed
status: reopenedclosed