Fixed a bug with .append() and <td>/<tr>.

This commit is contained in:
John Resig
2007-01-10 07:00:02 +00:00
parent 6de5275687
commit 84ecf3937b

View File

@@ -1355,16 +1355,17 @@ jQuery.extend({
// Convert html string into DOM nodes
if ( typeof arg == "string" ) {
// Trim whitespace, otherwise indexOf won't work as expected
var s = jQuery.trim(arg), div = document.createElement("div"), tb = [];
var s = jQuery.trim(arg), div = document.createElement("div"), tb = [];
var wrap =
var wrap =
// option or optgroup
!s.indexOf("<opt") &&
[1, "<select>", "</select>"] ||
(!s.indexOf("<thead") || !s.indexOf("<tbody") || !s.indexOf("<tfoot")) &&
[1, "<table>", "</table>"] ||
!s.indexOf("<tr") &&
!s.indexOf("<tr") &&
[2, "<table><tbody>", "</tbody></table>"] ||
// <thead> matched above
@@ -1400,6 +1401,7 @@ jQuery.extend({
arg = div.childNodes;
}
if ( arg.nodeType )
r.push( arg );
else
r = jQuery.merge( r, arg );