0

i just need a clear explanation for this:

        var lastCol = getColumnCount()-1; 
        var lastRow = getRowCount()-1; 
        var table = document.getElementById(TableID); 
        var rowSum; /*Summation of all the values in of rows*/
        var columnValue; 
        if(ths == 'on'){

            for(var b=1;b<lastRow+1;b++){
                rowSum = 0;
                for(var i=0;i<lastCol-1;i++){ 
                    columnValue =  table.rows[i].cells[b].childNodes[0].value;
                    if(columnValue != '' && !isNaN(columnValue)){
                        rowSum = eval(rowSum) + parseInt(columnValue);
                    }
                    table.rows[lastRow].cells[b+2].innerHTML = rowSum; 
                }
            }

        }else{
            var cIndex = ths.parentNode.cellIndex; 
            rowSum = 0; 
            for(var i=0;i<lastRow;i++) {
                cIndex+=2;
                columnValue =  table.rows[i].cells[cIndex].childNodes[0].value;
                if(columnValue != '' && !isNaN(columnValue)){
                    rowSum = eval(rowSum) + parseInt(columnValue);
                }
            } 
            table.rows[lastRow].cells[cIndex].innerHTML = rowSum; 
        }
    } 
function timedRefresh(timeoutPeriod) {
    setTimeout("location.reload(true);",timeoutPeriod);
}

i get the process and the idea of these codes,
i just don't fully understand the meaning of this line

 columnValue =  table.rows[i].cells[b].childNodes[0].value;

and the function timedRefresh, i just got this from the internet and i want to know what they exactly do so i can create my own function like this.
(sorry for being such a newbie ..) any help would be greatly appreciated ! thnx!

1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by azareth
0

anyone?!? i really need help in this, i know this is such a dumb question .. but i urgently need you help .. thnx

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.