I'm trying to make a script to generate a different logo everytime a user visits a website, so far i have the following code:
How would i call this is the HTML to display the image link that has been generated?
Edit: adding document.write('<img src="'+genlogo()+'" border=0></a>'); to the end makes the image on the page but does not position it where i want, how would i position the image?
Edit: i've got it sorted, thanks for the help
Code:
<script type="text/javascript">
function get_random()
{
var ranNum= Math.floor(Math.random()*5);
return ranNum;
}
</script>
<script type="text/javascript">
function genlogo()
{
var whichlogo=get_random();
var logo=new Array(6)
logo[0]="anysite.png";
logo[1]="anysitenew.png";
logo[2]="anysitecandy.png";
logo[3]="anysiteclass.png";
logo[4]="anysiteweb2.png";
logo[5]="anysiteplas.png";
return logo[whichlogo]);
}
</script>
How would i call this is the HTML to display the image link that has been generated?
Edit: adding document.write('<img src="'+genlogo()+'" border=0></a>'); to the end makes the image on the page but does not position it where i want, how would i position the image?
Edit: i've got it sorted, thanks for the help

Last edited: