Generate random URL : random : Math JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Math » random »

 

Generate random URL

















<HTML>

<HEAD>

<SCRIPT language="JavaScript">
<!--

var rand_url= new Array()
rand_url[0]="http://www.navioo.com";
rand_url[1]="http://www.navioo.com";
rand_url[2]="http://www.navioo.com";
rand_url[3]="http://www.navioo.com";
rand_url[4]="http://www.navioo.com";

var rand_num= Math.floor(Math.random()*5);

//-->
</SCRIPT>

</HEAD>

<BODY>

<H2>List of Cars:</H2>

<SCRIPT language="JavaScript">
<!--
 document.write("<A HREF='"+rand_url[rand_num]+"'>"+rand_url[rand_num]+"</A>");
//-->
</SCRIPT>

</BODY>

</HTML>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Math
» random