I am having a little problem here.
I have a <script language ="JavaScript" runat="server"> code that reads a table from a website, parses data and stores it in a 2-D array. It works correctly; I can display the data using Response.Write.
Now, I would like to use the data in the array to construct my own table and display it in the browser. I thought I would just add:
</head>
<body onload="tableCreator();">
<table id="table" border="1">
<tr>
<td id="Document Number">Document Number</td>
<td id="Document Link">Document Link</td>
<td id="Date Filed">Date Filed</td>
<td id="Date Entered">Date Entered</td>
<td id="Date Terminated">Date Terminated</td>
<td id="Description">Description</td>
</tr>
</table>
<body>
</html>
after script ends, but this is where problems start. I don't know where to insert the tableCreator()function. If I do it inside the (script language ="JavaScript" runat="server") code (in order to be able to use the array's data), the function is not called. When I change the tag to (script language ="JavaScript") (no runat="server"), the function is called, but the script isn't run (I have multiple Response.Write and nothing, but the table, is being printed)
function tableCreator () {
var table = document.getElementById("table");
var rowCount = table.rows.length;
var row;
row = table.insertRow(rowCount);
var cell1 = row.insertCell(0);
cell1.innerHTML = "1";
}
Any ideas?