Prototype.js - Element.insert (Element) is ignored in IE 6?

I use IE 6 (corporate credentials) on XP, and also (primarily) Firefox 3. In them, I make a DHTML table using the prototype.js library version 1.6.0.3.

I have javascript code for an event handler to add a row to a table that works fine in Firefox but is completely ignored in Internet Explorer. I can go through the code in the MS "script" debugger (yes, I know that it was deprecated and deprecated, but it was available), so I know that the event is being connected.

The code is something like:

var xTable = $( 'x_list')  // id of x...
var aRow = new Element( 'tr')
aRow.setAttribute( 'id', id)
. . .
var xEl = new Element( 'td')
. . .
aRow.insert( xEl)
. . .
// alert( aRow.inspect() )
// alert( xTable.inspect() )
debugger  // check insert() implementation under IE
xTable.insert( aRow)

Has anyone else had experience with conflicts between Element.insert () and Explorer?

+3
3

TR TBODY, TABLE. IE // .

+6

<tbody> <table>, , <table>.

, . , Javascript , <tbody>.

+2

slosd answered this excellently, just a small addition: TBODY is required in IE7, but not in IE8.

+1
source

Source: https://habr.com/ru/post/1709628/


All Articles