]> source.dussan.org Git - jquery.git/commitdiff
Fixed appending rows to a table.
authorJohn Resig <jeresig@gmail.com>
Tue, 13 Jun 2006 02:20:15 +0000 (02:20 +0000)
committerJohn Resig <jeresig@gmail.com>
Tue, 13 Jun 2006 02:20:15 +0000 (02:20 +0000)
jquery/jquery.js

index 9f35e1a91348d74cf763e97fa17fd2c4bd0212cf..b6738a800a506f54ae77ef58ff8fa9bf0344ce22 100644 (file)
@@ -387,8 +387,16 @@ $.clean = function(a) {
        var r = [];
        for ( var i = 0; i < a.length; i++ ) {
                if ( a[i].constructor == String ) {
+                       if ( a[i].indexOf("<tr") == 0 ) {
+//alert("tr");
+                               var tr = true;
+                               a[i] = "<table>" + a[i] + "</table>";
+                       }
                        var div = document.createElement("div");
                        div.innerHTML = a[i];
+                       if ( tr ) {
+                               div = div.firstChild.firstChild;
+                       }
                        for ( var j = 0; j < div.childNodes.length; j++ ) {
                                r[r.length] = div.childNodes[j];
                        }