Forum OpenACS Q&A: Re: Problem with TCL

Collapse
4: Re: Problem with TCL (response to 1)
Posted by Kabowei Oki on
function onLoad() {

if (some_expression){
    var out= '';
    var output = '';
    if (cookieType == 'xxx') {
      getA();
    }
    if (cookieType == 'yyy'){
      getB();
}

    data = new Array();
    var rows = output.split(',');
    if (rows.length == 1){
        data[0]= rows;
    }
    else {
        data = rows;
    }

}


function getA(){
    test_output += '<table cellspacing="0" cellpadding="1" border="1" align="center">'

    for (c=0; c<data.length; c++){
        outputRow(data[c], 7);
    }
    test_output += ('</table>');
}

function getB(){
    test_output += '<table cellspacing="0" cellpadding="1" border="1" align="center">'
    for (c=0; c<data.length; c++){
        outputRow(data[c], 3);
    }
    test_output  += ('</table>');
}