lucas4ce
September 25th, 2008, 08:33 PM
As the title suggests really.
I have the following javascript function which only completes, by which I mean continues to the end of the script and fills up the html table, if I put an alert() where I've shown below. Without the alert() in this location the function appears to stop just before the alert() position, i.e. it successfully clears the html table and appears to simply stop after the for(b=3;b<d;b++) loop.
This is just weird! And slightly annoying, any help would be really appreciated..
function createdesigntable() // calls the creation of the results selection table
{
// copy inputdata into designinputdata and send to server for calculation
//document.cookie = 'name=' + sessionobject.designinputdata[0];
//sessionobject.designinputdata = sessionobject.inputdata;
senddatatoserver(serialise(sessionobject.inputdata ));
// clear the existing table except headers
var b;
var c = document.getElementById('designtablesteel');
var d = c.rows.length;
for(b=3;b<d;b++)
{
c.deleteRow(3);
}
//the alert() goes here!!!
var t = steelsections.name.length;
var s = t+3;
var v; // row index
var e; // cell index
var w;
var u; //array index
var y;
var str="designtablesteelrow";
// column or cell index
for(v=3;v<s;v++)
{
w = c.insertRow(v);
x = c.rows[v];
u=v-3;
rowid=str+u;
x.id = rowid;
document.getElementById(rowid).onclick = function() {designtablesteelrowpress(this.id)};
w.insertCell(0).innerHTML=steelsections.name[u];
w.insertCell(1).innerHTML=steelsections.mass[u];
w.insertCell(2).innerHTML=steelsections.depth[u];
w.insertCell(3).innerHTML=steelsections.breadth[u];
w.insertCell(4).innerHTML=steelsections.deflection[u];
w.insertCell(5).innerHTML=steelsections.urdef[u];
w.insertCell(6).innerHTML=steelsections.urbend[u];
w.insertCell(7).innerHTML=steelsections.urshear[u];
for(e=0;e<8;e++)
{
z = x.cells[e];
z.className = "designtablecell";
}
}
fillresults();
}
I have the following javascript function which only completes, by which I mean continues to the end of the script and fills up the html table, if I put an alert() where I've shown below. Without the alert() in this location the function appears to stop just before the alert() position, i.e. it successfully clears the html table and appears to simply stop after the for(b=3;b<d;b++) loop.
This is just weird! And slightly annoying, any help would be really appreciated..
function createdesigntable() // calls the creation of the results selection table
{
// copy inputdata into designinputdata and send to server for calculation
//document.cookie = 'name=' + sessionobject.designinputdata[0];
//sessionobject.designinputdata = sessionobject.inputdata;
senddatatoserver(serialise(sessionobject.inputdata ));
// clear the existing table except headers
var b;
var c = document.getElementById('designtablesteel');
var d = c.rows.length;
for(b=3;b<d;b++)
{
c.deleteRow(3);
}
//the alert() goes here!!!
var t = steelsections.name.length;
var s = t+3;
var v; // row index
var e; // cell index
var w;
var u; //array index
var y;
var str="designtablesteelrow";
// column or cell index
for(v=3;v<s;v++)
{
w = c.insertRow(v);
x = c.rows[v];
u=v-3;
rowid=str+u;
x.id = rowid;
document.getElementById(rowid).onclick = function() {designtablesteelrowpress(this.id)};
w.insertCell(0).innerHTML=steelsections.name[u];
w.insertCell(1).innerHTML=steelsections.mass[u];
w.insertCell(2).innerHTML=steelsections.depth[u];
w.insertCell(3).innerHTML=steelsections.breadth[u];
w.insertCell(4).innerHTML=steelsections.deflection[u];
w.insertCell(5).innerHTML=steelsections.urdef[u];
w.insertCell(6).innerHTML=steelsections.urbend[u];
w.insertCell(7).innerHTML=steelsections.urshear[u];
for(e=0;e<8;e++)
{
z = x.cells[e];
z.className = "designtablecell";
}
}
fillresults();
}