# Can't update tbody in IE 6 with page\['name'\].replace\_html

**URL:** <https://www.ruby-forum.com/t/cant-update-tbody-in-ie-6-with-page-name-replace-html/88740>\
**Category:** Rails\
**Created:** [March 13, 2007, 11:47pm UTC](https://www.ruby-forum.com/t/cant-update-tbody-in-ie-6-with-page-name-replace-html/88740 "2007-03-13T23:47:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 13, 2007, 11:47pm UTC](https://www.ruby-forum.com/t/cant-update-tbody-in-ie-6-with-page-name-replace-html/88740/1 "2007-03-13T23:47:26Z")

</div>

Can anyone verify that you can’t update a tbody element in IE 6 by using  
page[‘name]’.replace\_html?

I’ve tried all three ways I know to update the innerHTML property of the  
tbody and it won’t take.

But page[‘name’].insert\_html works fine.

Just look for corroboration.

Thanks,  
Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 14, 2007, 12:02am UTC](https://www.ruby-forum.com/t/cant-update-tbody-in-ie-6-with-page-name-replace-html/88740/2 "2007-03-14T00:02:59Z")

</div>

Hi Wes,

Wes G. wrote:

> Can anyone verify that you can’t update a tbody  
> element in IE 6 by using page[‘name]’.replace\_html?

It’s true for all IE versions. IE uses MS Table DOM, not the W3C DOM.  
There’s an explanation on MSDN. You can replace a tbody, you can insert  
another tbody above or below, but you basically can’t do anything via  
Ajax  
with an existing

 or . I think you can update a if that  
does anything for you. Not 100% sure of all the caveats on that though.

hth,  
Bill

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 14, 2007, 12:20am UTC](https://www.ruby-forum.com/t/cant-update-tbody-in-ie-6-with-page-name-replace-html/88740/3 "2007-03-14T00:20:04Z")

</div>

I guess this was why I got that error with the Dojo FilteringTable on  
IE.

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 14, 2007, 1:53am UTC](https://www.ruby-forum.com/t/cant-update-tbody-in-ie-6-with-page-name-replace-html/88740/4 "2007-03-14T01:53:13Z")

</div>

Hi Wes,

Good info. Thanks! I’ll put this in the Save folder.

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [March 14, 2007, 12:41am UTC](https://www.ruby-forum.com/t/cant-update-tbody-in-ie-6-with-page-name-replace-html/88740/5 "2007-03-14T00:41:38Z")

</div>

What I needed to do was to replace a whole set of rows (in a datagrid)  
with another set.

Luckily, IE does follow DOM level 2 (at least for what I needed), and I  
solved my problem by deleting each row from the bottom up (you have to  
do it from the bottom up or the relative indexing of rows within the

 element will change), and then doing a "page.insert\_html" to the bottom of the tbody (which will at that point have no rows in it).

It is a pain in the arse, but it does work in both IE and FF.  
XSLDatagrid::ROWS\_TO\_DISPLAY is the number of rows in the tbody named  
xdgRowSet\_thingy.

Here’s the code:

render :update do |page|  
(0…XSLDatagrid::ROWS\_TO\_DISPLAY - 1).to\_a.reverse.each do |index|  
page \<\<  
“$(‘xdgRowSet\_#{XSLDatagrid::CONTAINER\_ID}’).deleteRow(#{index});”  
end  
page.insert\_html(:bottom, “xdgRowSet\_#{XSLDatagrid::CONTAINER\_ID}”,  
output)

…other stuff…  
end

I have such mixed feelings about this project, it causes me so much  
grief but then I always end up learning something useful by overcoming  
all these ridiculous f-in’ problems ;).

Wes
