J'affiche des éléments avec JSON
Avant de commencer, voici l'ordre que je suis censé avoir: toto-> titi-> tata-> trtr-> tktk-> tztz
Je dois publier le prochain job à chaque itération, sachant que le premier est toto
Donc pour l'instant j'ai: toto titi tata
Et je ne vois pas comment faire la boucle pour voir le reste.
Pour info, downstreamproject affiche le prochain job.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 function getall() { ajaxGet(".../toto/api/json?pretty=true", recover); } getall(); function ajaxGet(url, callback) { ... } function recover(response){ var Json = JSON.parse(response); var Data = Json.downstreamProjects.map(function(group) { console.log("toto"); //toto console.log(group.name); //titi ajaxGet2("..."+group.name+"/api/json?pretty=true", recover2); }); } function ajaxGet2(url, callback) { .... } function recover2(response){ var Json = JSON.parse(response); var Data = Json.downstreamProjects.map(function(group) { console.log(group.name); //tata }); }
Résultat actuel:
toto
titi
tata
Ce que je souhaite (avec la boucle):
toto
titi
tata
trtr
tktk
tztz
Partager