Suchen
Inside Forum
Nützliche Links
PHP Jobs
phpforum.de Tipp
 
phpforum.de bei Facebook
 
phpforum.de bei Twitter
 
PHP Test


werbung



Zurück   PHP Forum: phpforum.de > andere (Programmier-)Sprachen > JavaScript

JavaScript Alles rund um JavaScript

Antwort
 
Themen-Optionen Ansicht
  #1  
Alt 10.09.2003, 21:23
s3 s3 ist offline
Neuer Besucher
 
Registriert seit: 07.09.2003
Beiträge: 2
Standard

i use an array to save different informations, which is putting in the right place by "document.getElementById('content').innerHTML = test".

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>

Mit Zitat antworten
  #2  
Alt 11.09.2003, 18:35
24chris.de.vu 24chris.de.vu ist offline
Besucher
 
Registriert seit: 08.09.2003
Ort: FR
Beiträge: 38
24chris.de.vu eine Nachricht über ICQ schicken
Standard

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
Mit Zitat antworten


Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu
Ähnliche Themen
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


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:01 Uhr.


Powered by vBulletin® Version 3.8.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Powered by NuWiki v1.3 RC1 Copyright ©2006-2007, NuHit, LLC