Topic: RJS error

Hi everyone.  Was hopeing that you maybe able to help me debug this error in IE7

This by the way works perfectly in firefox smile

when I click on a ajax link that is designed to remove a row of a table I run into this problem

RJS error: [object error]

["brief-1-estimate_line_item-view-69-row"].each(Element.remove)

Im assuming that it is this code.  but it could possable be other code.

Re: RJS error

Ok Ive just narrowed it down to some other js code

Element.update("brief-1-estimate_line_item-category-PRODUCTION-CREW-total", "
<td colspan=\"5\">
Total
</td>
<td>
0.0
</td>

<td colspan=\"2\">
Total Cost:
</td>
<td>
0.0
</td>
<td colspan=\"2\"></td>

");


now what is wrong with this?

Re: RJS error

IE is pretty finnicky about innerHTML and table elements. For example, it's a read-only property on tr and tbody elements. You might have to rewrite the whole table to get it to work.

vinnie - rails forum admin

Re: RJS error

vin wrote:

IE is pretty finnicky about innerHTML and table elements. For example, it's a read-only property on tr and tbody elements. You might have to rewrite the whole table to get it to work.

so where is the "I hate IE thread" in this forum? wink   

Thanks vin.  NO THANKS IE!!!!!!

Re: RJS error

I think im going to have to solve this by having a partial that looks like....

<%= content.to_s %>

just because of IE.

Re: RJS error

I just checked some code I have along similar lines and I can make one or more TRs update OK but I haven't tried doing individual cells in a row.  The element I'm inserting them into is a TBODY so the header part of my table remains unaffected.  What happens if you wrap a TR around the code above and try updating the tbody instead of the TR?