Bonjour,
Savez-vous s'il y a moyen de récupérer le nom de l'indice d'un tableau associatif ?
Exemple :
Le but étant de récupérer "AA", "BA", ...
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 var montab = new Array(); montab["AA"] = "abcd"; montab["BA"] = "efgh"; montab["AB"] = "ijkl"; montab["BB"] = "mnop"; montab["CA"] = "qrst"; .. for (var indice in montab){ nom_ind = montab[indice].fonction_que_je_ne_connais_pas; window.alert("nom indice " + indice + " = " + nom_ind); }
.. le problème étant la fonction_que_je_ne_connais_pas bien sûr
Merci pour votre aide,
NikoBe
Partager