Im calling an api and i get an array with multiple arrays. So i want to do each of the arrays and pick up the value number 3 of each array and send that value to my controller method called addGame. If i debugg it i can se that it picks the right value each time it loops the each loop and it goes to my controller method but the value it sends is null. Here is my code:
var date = "02/13/2014";
$.ajax({
dataType: "jsonp",
type: "post",
crossDomain: true,
url: 'http://stats.nba.com/stats/scoreboard/?LeagueID=00&gameDate=' + date + '&DayOffset=0',
success: function (val) {
var result = val.resultSets[0].rowSet;
$.each(result, function (key, value) {
var gameID = this[2];
$.ajax({
async: false,
type: "post",
url: "/Stats/addGame",
data: gameID,
});
});
}
})
And here is my controller:
public void addGame(string gameid)
{
}