bonjour ,
voilà je n'ai pas trouvé comment spécifier la lecture d'un tableau dans un tableau (hormis faire une boucle), mais je souhaitais faire un mapping direct
j'ai un ordre ajax / JSON qui me donne un retour que je map via
j'ai en retour dans le log couldn't display seasonId of undefined
les data en retours de mon call ajax sont
voilà je n'ai pas trouvé comment spécifier la lecture d'un tableau dans un tableau (hormis faire une boucle), mais je souhaitais faire un mapping direct
j'ai un ordre ajax / JSON qui me donne un retour que je map via
Code:
var SEASON = {
"td": {
"season<-results[0].seasonList": {
"span.SeasonID": function(arg) {
// log le résultat de SeasonId
console.log ('season.seasonId:' + season[0].seasonId);
j'ai en retour dans le log couldn't display seasonId of undefined
les data en retours de mon call ajax sont
Code:
....
"results": [
{
"title": "Game of Thrones",
"originalTitle": "Game of Thrones",
"year": 2011,
"watched": false,
"artwork": {
"POSTER": [
{
"id": 1,
"source": "SERIES",
"artworkId": 1162,
"locatedId": 6420,
"generatedId": 4005,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000.series.poster.21285489.default.jpg"
},
{
"id": 1,
"source": "SERIES",
"artworkId": 1162,
"locatedId": 6418,
"generatedId": 4003,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000.series.poster.21285491.default.jpg"
},
{
"id": 1,
"source": "SERIES",
"artworkId": 1162,
"locatedId": 6416,
"generatedId": 4006,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000.series.poster.21262775.default.jpg"
},
{
"id": 1,
"source": "SERIES",
"artworkId": 1162,
"locatedId": 6419,
"generatedId": 4004,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000.series.poster.21285490.default.jpg"
},
{
"id": 1,
"source": "SERIES",
"artworkId": 1162,
"locatedId": 6417,
"generatedId": 4002,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000.series.poster.21285492.default.jpg"
}
]
},
"seriesId": 1,
"seasonList": [
{
"title": "Game of Thrones",
"originalTitle": "Game of Thrones",
"year": 2011,
"watched": false,
"artwork": {
"POSTER": [
{
"id": 10,
"source": "SEASON",
"artworkId": 20940,
"locatedId": 21443,
"generatedId": 18845,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000_001.season.poster.121361-1-4.default.jpg"
}
]
},
"seriesId": 1,
"seasonId": 10,
"season": 1,
"artworkCount": 1
},
{
"title": "Game of Thrones",
"originalTitle": "Game of Thrones",
"year": 2012,
"watched": false,
"artwork": {
"POSTER": [
{
"id": 11,
"source": "SEASON",
"artworkId": 21026,
"locatedId": 21521,
"generatedId": 18896,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000_002.season.poster.121361-2-15.default.jpg"
}
]
},
"seriesId": 1,
"seasonId": 11,
"season": 2,
"artworkCount": 1
},
{
"title": "Game of Thrones",
"originalTitle": "Game of Thrones",
"year": 2013,
"watched": false,
"artwork": {
"POSTER": [
{
"id": 34,
"source": "SEASON",
"artworkId": 21168,
"locatedId": 21573,
"generatedId": 18976,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000_003.season.poster.121361-3-19.default.jpg"
}
]
},
"seriesId": 1,
"seasonId": 34,
"season": 3,
"artworkCount": 1
},
{
"title": "Game of Thrones",
"originalTitle": "Game of Thrones",
"year": 2014,
"watched": false,
"artwork": {
"POSTER": [
{
"id": 33,
"source": "SEASON",
"artworkId": 21140,
"locatedId": 21552,
"generatedId": 18946,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000_004.season.poster.121361-4-13.default.jpg"
}
]
},
"seriesId": 1,
"seasonId": 33,
"season": 4,
"artworkCount": 1
},
{
"title": "Game of Thrones",
"originalTitle": "Game of Thrones",
"year": 2015,
"watched": false,
"artwork": {
"POSTER": [
{
"id": 1,
"source": "SEASON",
"artworkId": 1165,
"locatedId": 6401,
"generatedId": 4001,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000_005.season.poster.121361-5-5.default.jpg"
}
]
},
"seriesId": 1,
"seasonId": 1,
"season": 5,
"artworkCount": 1
},
{
"title": "Game of Thrones",
"originalTitle": "Game of Thrones",
"year": 2016,
"watched": true,
"artwork": {
"POSTER": [
{
"id": 35,
"source": "SEASON",
"artworkId": 21199,
"locatedId": 21608,
"generatedId": 18998,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000_006.season.poster.121361-53.default.jpg"
},
{
"id": 35,
"source": "SEASON",
"artworkId": 21199,
"locatedId": 23750,
"generatedId": 21142,
"artworkType": "POSTER",
"filename": "g/ga/Game Of Thrones_0000_006.season.poster.121361-49.default.jpg"
}
]
},
"seriesId": 1,
"seasonId": 35,
"season": 6,
"artworkCount": 2
}
],
"artworkCount": 5
}
]
}