I'm working with javascript for the first time on a web site. Can somebody tell me what's going on with this:
It comes out just fine and gives me a randomised list of "companies" which is what i want.. but the list is seperated by commas...
company 1a
,
company 2a
,
company 3a etc...
where are the "commas" coming from and can i get rid of them?
<script language=JavaScript>
var company=new Array()
company[0]='<p>Company 1a</p> <br/>'
company[1]='<p>Company 2a</p> <br/>'
company[2]='<p>Company 3a</p> <br/>'
company[3]='<p>Company 4a</p> <br/>'
company[4]='<p>Company 5a</p> <br/>'
company[5]='<p>Company 6a</p> <br/>'
company.sort(function() {return 0.5 - Math.random()});
document.write(company);
</script>
thanks for any suggestions
It comes out just fine and gives me a randomised list of "companies" which is what i want.. but the list is seperated by commas...
company 1a
,
company 2a
,
company 3a etc...
where are the "commas" coming from and can i get rid of them?
<script language=JavaScript>
var company=new Array()
company[0]='<p>Company 1a</p> <br/>'
company[1]='<p>Company 2a</p> <br/>'
company[2]='<p>Company 3a</p> <br/>'
company[3]='<p>Company 4a</p> <br/>'
company[4]='<p>Company 5a</p> <br/>'
company[5]='<p>Company 6a</p> <br/>'
company.sort(function() {return 0.5 - Math.random()});
document.write(company);
</script>
thanks for any suggestions