##Problem###
I have a 'random' button on my index.html, when clicked is supposed to link to the javascript which is in another file in the same folder, this click will select a random html to display (001-005.html)
In Index.html head:
<script src="javascript.js" language="JavaScript"> </script>
Code for my random button the index.html
<A HREF="javascript:randomlinks()">Random</A>
Javascript Code: (external file, same folder)
<script type="text/javascript">
function randomlinks()
{
var myrandom=Math.round(Math.random()*5)
var links=new Array()
links[0]="index.html"
links[1]="001.html"
links[2]="002.html"
links[3]="003.html"
links[4]="004.html"
links[5]="005.html"
window.location=links[myrandom] --- (Keeps saying there is something wrong with this line)
}
</script>
I have a 'random' button on my index.html, when clicked is supposed to link to the javascript which is in another file in the same folder, this click will select a random html to display (001-005.html)
In Index.html head:
<script src="javascript.js" language="JavaScript"> </script>
Code for my random button the index.html
<A HREF="javascript:randomlinks()">Random</A>
Javascript Code: (external file, same folder)
<script type="text/javascript">
function randomlinks()
{
var myrandom=Math.round(Math.random()*5)
var links=new Array()
links[0]="index.html"
links[1]="001.html"
links[2]="002.html"
links[3]="003.html"
links[4]="004.html"
links[5]="005.html"
window.location=links[myrandom] --- (Keeps saying there is something wrong with this line)
}
</script>