I get data from a $.ajax call but cant work correctly with the data of it. Here is my code.
function OnSuccessResultSet(data, status) {
var output;
for (var i in data.recordset) {
output += "<li><a href='#'>";
for (var j = 0; j < metaName.length; j++) {
var testVar = metaName[j];
output += " <h2>" + data.recordset[i].testVar+ "</h2>";
alert(data.recordset[i].testVar);
alert(testVar);
alert(data.recordset[i].LABEL);
};
output += "</a></li>";
}
$(output).appendTo("#content1");
$('#content1').listview('refresh');
}
The first alert gives me an undefined back. Second alert gives me LABEL back and third one gives me the value of LABEL. My metaName has all attribute values for my element from recordset. I fill also my metaName array with a $.ajax call. I dont find my mistake. :/