我需要在循环中调用一个函数。
我有以下代码....
do {
var name = prompt("Enter name:");
if (!isNaN(age) && name != null && name != "") {
names[i] = name;
}
loop = confirm("Add new name?");
i++;
// at this place I want to call the function
// addnew(document.getElementById("newtable")"; so when someone clicks cancel in the confirm box the javascript creates a dynamic table from the array names
} while (loop);
任何人都知道我如何调用函数addnew?