I am currently having issues with Internet explorer and a Javascript that I created. I've been trying to find where the incompatibility issue originates from, but I've been unable to pinpoint it.
This works fine in Firefox 26, but it doesn't seem to actually generate a table in Internet Explorer 11.
function InsertTable()
{
column = document.getElementById("Columns").value
row = document.getElementById("Rows").value
cellwidth = 100 / column
table = '<table width="100%" border="2px">'
while(row > 0)
{
columncopy = column
table = table + '<tr>'
while(columncopy > 0)
{
table = table + '<td width="' + cellwidth + '%"></td>'
columncopy = columncopy - 1;
}
table = table + '</tr>'
row = row - 1;
}
table = table + '</table>'
document.getElementById("mainedit").focus();
document.execCommand('insertHTML', false, table);
}
Update: I managed to narrow down the issue to a single line of code, it is going through the entire thing and not actually placing it correctly.
document.execCommand('insertHTML', false, table);
Is the source of the issue.