getIndividualMap
関数で変数を使用しようとしていますが、undefined
エラーが発生します。何が問題なのですか?
var i;
for(i=0;i<=(data.length -1);i++)
{
$('#ResultsId').append("<table border='1'>" +
"<tr>" +
"<th>UserID</th>" +
"<th>RUNDATE</th>" +
"<th>NAME</th>" +
"<th>TIME</th>" +
"<th>DISTANCE (KM)</th>" +
"</tr>" +
"<tr>" +
"<td>" + data[i].UserID + "</td>" + " " +
"<td>" + data[i].runDate + "</td>" + " " +
"<td>" + data[i].firstName + "</td>" + " " +
"<td>" + data[i].Time + "</td>" + " " +
"<td>" + data[i].Distance + "</td>" +
"<td>" +"<a href='#' onclick= 'getIndividualMap(i)'>" + data[i].UserID +"</a>" + "</td>" +
"</tr>" +
"</table>" );
}
getIndividualMap(){
console.log(i);
}