I'm making a Javascript system to build tables, so I can view large tables in smaller pieces. I use the "document.createElement" and "appendChild" methods to create and remove elements from my table.
Got everything working, no problems. Until I test my code in IE.
After a little investigation, I create this:
Expand|Select|Wrap|Line Numbers
- <div id="ListContainer" class="Info">
- <table id="ListTable">
- <tr>
- <td>Hello</td>
- </tr>
- </table>
- </div>
- <script type="text/javascript">
- var table = document.getElementById("ListTable");
- var newRow = document.createElement("tr");
- var newCol = document.createElement("td");
- newCol.innerHTML = "Row2";
- newRow.appendChild(newCol);
- table.appendChild(newRow);
- </script>
Weird thing is that IE usually flashes the error icon in the bottom-left corner when a script is broken, but that doesn't happen now.
Nothing happens, no errors, no changes.
I can't find anything wrong with this code.
Anybody know what is going on there?