Creative Name
08-31-2003, 10:03 PM
Could someone help me with the following script?
Right now it says "Error: 'return' statement outside of function"
I have a smaller, revised script a couple posts down, you can check there first if you like
<html>
<head>
<script type="text/javascript">
Array.prototype.random = Joe () ;
{return this[Math.round (Math.random() * Math.ceil (this.length / 10) * 10) % this.length]};
var sound = new Array();
sound[0] = {href:'C:\site\lte_stateofgrace.mp3', title:'State of Grace by: Liquid Tension Experiment'};
sound[1] = {href:'C:\site\lte_freedomofspeech.mp3', title:'Freedom of Speech by: Liquid Tension Experiment'};
sound[2] = {href:'C:\site\mm_icanonlyimagine.mp3', title:'I Can Only Imagine by: Mercy Me'};
var s = sound.random();
document.write('<embed src="s.href', '"hidden="false" autostart="true" nosave="true" width=145 height=55>') ;
document.write('<small class="min">You are listening to:"s.title', '</small>') ;
// -->
</script>
<title>Home</title>
</head>
<body bgcolor="black" link="red" alink="white" vlink="red"
<script language="javascript">
OnLoad="Joe"
</script>
>
</body>
</html>
Thanks
Right now it says "Error: 'return' statement outside of function"
I have a smaller, revised script a couple posts down, you can check there first if you like
<html>
<head>
<script type="text/javascript">
Array.prototype.random = Joe () ;
{return this[Math.round (Math.random() * Math.ceil (this.length / 10) * 10) % this.length]};
var sound = new Array();
sound[0] = {href:'C:\site\lte_stateofgrace.mp3', title:'State of Grace by: Liquid Tension Experiment'};
sound[1] = {href:'C:\site\lte_freedomofspeech.mp3', title:'Freedom of Speech by: Liquid Tension Experiment'};
sound[2] = {href:'C:\site\mm_icanonlyimagine.mp3', title:'I Can Only Imagine by: Mercy Me'};
var s = sound.random();
document.write('<embed src="s.href', '"hidden="false" autostart="true" nosave="true" width=145 height=55>') ;
document.write('<small class="min">You are listening to:"s.title', '</small>') ;
// -->
</script>
<title>Home</title>
</head>
<body bgcolor="black" link="red" alink="white" vlink="red"
<script language="javascript">
OnLoad="Joe"
</script>
>
</body>
</html>
Thanks