lun. 19 mai 2008, 10h32
Gregory
atoutfox.public.association
Re: [Javascript] peut etre Thierry peut m'aider
Olivier,
Je ne connais pas grand chose de javascript
Il faut initaliser ligne par ligne - I think
function ShowTry(){
var tab_prix = new Array();
tab_prix[0] = new Array("0 0", "0 1");
tab_prix[1] = new Array("1 0", "1 1");
tab_prix[2] = new Array("2 0", "2 1");
tab_prix[3] = new Array("3 0", "3 1");
document.write("<TABLE BORDER=ON>");
document.write("<TH>i</TH><TH>[i][0]</TH><TH>[i][1]</TH>");
for(i=0; i<tab_prix.length; i++) {
document.write("<TR>");
document.write("<TD>",i,"</TD>");
document.write("<TD>",tab_prix[i][0],"</TD>");
document.write("<TD>",tab_prix[i][1],"</TD>");
document.write("</TR>");
}
document.write("</TABLE>");
alert(tab_prix.length);
}
--
Gregory
__
"OlivierH" <"nospam[contact]"@planitron.com> wrote in message
news:g0q4s3$2oqo$1@news.niouzes.net...
> Gregory,
>
> Sais tu comment je pourrais avoir le nombre de ligne du tableau,
>
> je fais cela :
> var tab_prix = new Array(new Array(2)); // bonne methode
>
>
> // Prix pour la vente
>
> tab_prix[0,1] = "Indifférent";
> tab_prix[1,1] = "40 000 E.";
> // jusqu'a 19
> tab_prix[19,1] = "1 200 000 E.";
>
> tab_prix[0,2] = "";
> tab_prix[1,2] = "40000";
> // jusqu'a 19
> tab_prix[19,2] = "1200000";
>
>
> alert(tab_prix.length);
>
> Me renvoit 3 , c'est pas normal, alors que ce site me dit qu'il doit
> renvoyer 20,
>
>
http://pagesperso-orange.fr/serge.knopf/topojs/topojs10.htm>
> D'avance merci
> Olivier
>
>
> Gregory a écrit :
>> Oui, mais ca depend de la version de javascript dit-il. En plus il
>> conseille de ne pas utiliser cette methode
>>
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000002358