diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2015-01-21 21:47:03 +0300 |
---|---|---|
committer | Oleg Gaidarenko <markelog@gmail.com> | 2015-02-11 16:49:59 +0300 |
commit | e984d1c79cc476062818e03df04a366baa13d197 (patch) | |
tree | 24b12eabcc278549c99f538be0ae9659df6c7982 /src | |
parent | 0ea342a6a6dce793c1b0f14f051c2573f40f4e44 (diff) | |
download | jquery-e984d1c79cc476062818e03df04a366baa13d197.tar.gz jquery-e984d1c79cc476062818e03df04a366baa13d197.zip |
Manipulation: don't auto-insert tbody
Fixes gh-1835
Closes gh-2021
Diffstat (limited to 'src')
-rw-r--r-- | src/manipulation.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index b11f56074..7c9f5049a 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -57,14 +57,14 @@ wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; -// Manipulating tables requires a tbody function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? + if ( jQuery.nodeName( elem, "table" ) && + jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; + return elem.getElementsByTagName( "tbody" )[ 0 ] || elem; + } + + return elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation |