I'm getting an error on the if statement - it can't make the compare ('unexpected indentifier') but I can't figure out why. I'm guessing it has to do with the fact that "table" is not a string object.. This code is implemented inside a C code so you should Ignor The "\n" and the " signs
"function postRow(i,table){\n"
"var desc=document.getElementsByName('description'+table);\n"
"var inter=document.getElementsByName('logInterval'+table);\n"
"if( table.equals('AN') || table.equals('OW') ){\n"
"var mu=document.getElementsByName('mul'+table);\n"
"var di=document.getElementsByName('div'+table);\n"
"var off=document.getElementsByName('offset'+table);\n"
"$.post('',{func:'saveTable'+table,\n"
"index:i,\n"
"description:desc[i].value,\n"
"logInterval:inter[i].value,\n"
"mul:mu[i].value,\n"
"div:di[i].value,\n"
"offset:off[i].value,\n"
"});"
"}\n"
"else if (table.equals('DG') ){\n"
"var count=document.getElementsByName('counterDG');\n"
"$.post('',{func:'saveTable'+table,\n"
"index:i,\n"
"description:desc[i].value,\n"
"logInterval:inter[i].value,\n"
"counter:count[i].value,\n"
"});\n"
"}\n"
"setTimeout(updateTable(table),1000);"
"}\n"
Calling the function:
onclick=postRow(i,"DG");
tables.equals()do?