kpdecker/jsdiff — Issue #9: Code fails in ie9
Author: jhoeft
Created: 2012-02-24 23:01:19+00:00
State: open

first off great lib. i love it.

i did notice an error when using it in ie. in the diffview you are treating tdata and rows as arrays not realizing they associative arrays. and when looping through them you are picking up properties like foreach and length. not sure if you meant to do that but ie chokes on it and doesn't behave nice. for my implementation i changed the code to:

for (var idx=0; idx < rows.length; idx++)
{
node.appendChild(rows[idx]);
}

instead of:

for(var idx in rows) node.appendChild(rows[idx]);

far less elegant but seams to be more acceptable to ie.

also had to change the tdata loop as well

for (var idx=0; idx < tdata.length; idx++)
{
node.appendChild(tdata[idx]);
}

again thanks for the great lib!