]> source.dussan.org Git - jquery.git/commitdiff
There was an issue with my table/tbody detection.
authorJohn Resig <jeresig@gmail.com>
Tue, 20 Jun 2006 15:42:10 +0000 (15:42 +0000)
committerJohn Resig <jeresig@gmail.com>
Tue, 20 Jun 2006 15:42:10 +0000 (15:42 +0000)
jquery/jquery.js

index 6263607aa9e9de097a04e1b6f7bcf0888606ccb6..86041dc29ced78a88a0815d80a4f6cb374067169 100644 (file)
@@ -423,10 +423,13 @@ $.fn.domManip = function(fn){
                var obj = this;
 
                if ( this.nodeName == 'TABLE' ) {
-                       if ( !this.firstChild ) {
-                               this.appendChild( document.createElement("tbody") );
-                       }
-                       obj = this.firstChild;
+                       var tbody = this.getElementsByTagName("tbody");
+
+                       if ( !tbody.length ) {
+                               obj = document.createElement("tbody");
+                               this.appendChild( obj );
+                       } else
+                               obj = tbody[0];
                }
 
                $.apply( obj, fn );