Ajax Error
Ajax Error
Hi,
I am getting the error requested unknown parameter '0' for row 0 when trying to make an ajax call and can't work out for the life of me what it is failing with.
The data returned from the server is:
[{"VillageName":"Test1"},{"VillageName":"Test2"}]
My Code is:
$('#clanMembers').dataTable({
ajax: {
url:"@Url.Action("GetUndecidedClanMembers")",
data: function (d) {
d.clanName = $('#ClanName').val();
d.proposedWarMatchupId = @Model.ProposedWarMatchupId;
},
dataSrc: function (json) {
for ( var i=0, ien=json.length ; i<ien ; i++ ) {
alert(json[i].VillageName);
}
return json;
},
columns: [
{data: "VillageName"}
]
}
});
Any hints on what I am doing wrong?
Answers
It's much easier to read your code if you use ````` before and after your code. The formatting is located below the comment box. Just FYI.
Yep just getting to grips with that :)
Do you have a website that we can look at your code? Some form of test site or jfiddle?
Not yet this is all run locally at the moment.