我使用以下Javascript函数。它将无效。它将在以下行中提供未定义错误,c= row.cells[0].innerText.strip();
function a()
{
var table = getServerObject("b");
var row,c;
for (var i = 2; i < table.rows.length - 1; i++)
{
row = table.rows[i];
if(row.cells.length==1)continue;
c= row.cells[0].innerText.strip();
if(c==0)
{
//Something
}
}
}
答案 0 :(得分:0)
“继续”是问题所在。见http://www.w3schools.com/js/js_break.asp
if(row.cells.length==1)continue;
代码应该是这样的
if(row.cells.length==1) {
c= row.cells[0].innerText.strip();
}