I have a function like this:
function appendTable2(dinput,id) {
return function(index, val) {
$('#matrix_datatable').find(id)
.append($('<td class="tableCells">')
.append(val.value[0].dinput + '</td>')
);
};
}
And it's called like:
$.each(mainData.locations.source_values, appendTable2('address1','#mAddress'));
The problem is that this appends undefined
to my table because of how this line works: .append(val.value[0].dinput + '</td>')
It's looking for an attribute in the object called dinput
instead of the value of dinput
. What's the proper syntax to use here?