From 057381c70d6ff56733d7dc25c86ab5c4ab047430 Mon Sep 17 00:00:00 2001 From: John Resig Date: Tue, 20 Jun 2006 15:42:10 +0000 Subject: [PATCH] There was an issue with my table/tbody detection. --- jquery/jquery.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/jquery/jquery.js b/jquery/jquery.js index 6263607..86041dc 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -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 ); -- 1.7.10.4