Hi, I'm pretty new to JS and have been trying to get a random array code to work. I have looked over my script multiple times and cannot seem to find what's wrong with the script. I'm hoping someone more experience can help me find what I'm doing wrong. Thanks
Code:
<html>
<HEAD>
<SCRIPT language="JavaScript">
<!--
function get_random()
{
var ranNum= Math.floor(Math.random()*8);
return ranNum;
}
function getaQuote()
{
var whichQuote=get_random();
var quote=new Array(8)
quote[0]="An expletive used by knowledgeable film buffs during any chase scene involving a foreign or ethnic locale, reflecting their certainty that a fruit cart will be overturned during the chase, and an angry peddler will run into the middle of the street to shake his fist at the hero\'s departing vehicle.";
quote[1]="In any horror film involving a human transforming into a monster, the hero never has to explain to the police the naked dead human body that is left after he has killed the monster. This despite the fact that no one in authority ever believes in the monster in the first place.";
quote[2]="Any stolen clothing or shoes will perfectly fit any male character whether they were stolen from a clothesline or removed from a Nazi guard, police officer, lookout, etc., who was overpowered and whose identity the clothing thief has now assumed";
quote[3]="In horror films that feature a mad scientist there is always a scene where the scientist explains the rational for his bizarre experiments. After the explanation, the scientist will always turn to his guest and say, 'You think I\'m mad, don\'t you?'”;
quote[4]="If there is more than one or two of an alien race, they are always roughly the same size as humans.";
quote[5]="Aliens usually speak english and have same colloquialisms. planet";
quote[6]="All members of alien species wear the same outfits, including clothing, hairstyles, and jewelery. This makes them readily identifiable. Aliens who do not dress like aliens are hiding something.";
quote[7]="This may, in fact, be a consequence of the fact that aliens all have single, monolithic cultures: one language, one religion, one outfit, per planet.";
alert(quote[whichQuote]);
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM name="form1">
<INPUT TYPE="button" value="Get a Quote!" onClick="getaQuote()">
</FORM>
</BODY>
</html>