|
#1
|
|||
|
|||
|
but between my information pieces are "," and i don't know why and how to erase them. anny solution for me, the java script beginner? thanks a lot. <html> <head> <script type="text/javascript"> <!-- function testfunc(){ var test = Array() test[0] ="test1" test[1] ="test2" test[2] ="test3" document.getElementById('content').innerHTML = test } //--> </script> </head> <body onLoad="testfunc()"> <div id="content"> </div> </body> </html> |
|
#2
|
|||
|
|||
|
this is because if you want to show the whole array (test) the values are separated by ",". If you don't want this you should write sth like this:
var x=test[0]+test[1]+test[2] document.getElementById('content').innerHTML = x or if you have more than 3 values: var x="" for(i=0;i<number of the Array;i++) x+=test[i] document.getElementById('content').innerHTML = x |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
|
|
|
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| arrays | pooleleven | PHP | 6 | 31.07.2006 23:46 |
| Arrays | UweKlau | PHP | 3 | 08.11.2005 17:35 |
| Arrays | laMorena | PHP | 2 | 21.07.2004 20:57 |
| arrays | maj | PHP | 6 | 09.02.2004 16:56 |
| arrays | Sascha | PHP | 1 | 01.01.1970 01:00 |