I have some Javascript code:
function addRow(tableID, rowId) {
var table = document.getElementById(tableID);
var rowPosition = document.getElementById(rowID).rowIndex;
//etc.
}
But this throws a Javascript error
“Uncaught ReferenceError: rowID is not
defined”
Though looking on Firebug, I can see that the functions receives a correct row identifier, but once the code reaches the second line inside the function the parameter rowID seems unknown.
Can anyone help?
JavaScript is case-sensitive. You’ve used
rowIdas the argument name (small “d”) while inside the function you haverowID(capital “D”). Change the argument torowIDto fix the issue.