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 comment:1
Changed January 29, 2009 03:27AM UTC by 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 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
.innerHTMLto 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 comment:4
resolution: | → fixed |
---|---|
status: | new → closed |
Updated documentation for
jQuery.supportto clarify this.
Changed January 25, 2010 09:58AM UTC by comment:5
resolution: | fixed |
---|---|
status: | closed → reopened |
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 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 comment:7
resolution: | → fixed |
---|---|
status: | reopened → closed |
Clarified: http://api.jquery.com/jQuery.support/
What makes you think that $.support.tbody==true is incorrect for Firefox 3.0?