Page 1 of 1

JS Array

Posted: Fri Jun 22, 2007 2:35 pm
by tecktalkcm0391
How do I do this PHP code in Javascript:

Code: Select all

<?php 
$e = array();

$e[] = 'One';
$e[] = 'Two';

$total = implode('',$e);
?>
All I have is:

Code: Select all

var e = new Array();

alert( e.join(""));
How do I make the "add array" (the $e[] = 'One'..ect.) happen?

Posted: Fri Jun 22, 2007 3:49 pm
by JellyFish

Posted: Fri Jun 22, 2007 4:06 pm
by Burrito
look at the push and split methods.

http://www.devguru.com/technologies/ecm ... array.html

Posted: Fri Jun 22, 2007 4:27 pm
by tecktalkcm0391
Thanks, I got it.