Bonjour a tous.
Je cree un tableau javascript du style
tab["1.1.2.4"] = "a"
tab["1.1.2.3"] = "b"
tab["1.3"] = "c"
Les cléd du tableau correspondent à des versions.
Comment faire pour trier le tableau selon les clés ?
Version imprimable
Bonjour a tous.
Je cree un tableau javascript du style
tab["1.1.2.4"] = "a"
tab["1.1.2.3"] = "b"
tab["1.3"] = "c"
Les cléd du tableau correspondent à des versions.
Comment faire pour trier le tableau selon les clés ?
un simple sort ne suffit pas ?
Il me mets que tableauContent n'existe pas ou a la valeurCode:
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 <script language="Javascript" type="text/javascript"> function CreerContent() { this.displayorder = displayorder; this.texte = texte; } function affiche(displayorder, texte) { document.write(this.displayorder + " - " + this.texte); } tableauContent = new Array(); Pour tout mes contenus{ var content = CreerContent('<AptrixCmpnt context="autoFill" key="DisplayOrder" type="content"/>','<AptrixCmpnt context="autoFill" key="texte" type="content"/>'); tableauContent.push(content); } for(var i=0;i<tableauContent.length;i++){ tableauContent[i].affiche(); document.write("<br>"); } </script>