...

View Full Version : Random Quote Generator



chloelee
10-23-2012, 12:37 AM
My random quote generator isn't working for some reason, so could someone point out what I'm doing wrong and help me fix it? PS- For a school project.

[CODE]

<html>
<head>
<script type="text/javascript">
var quotes = new Array(
"George, how long's it gonna be till we get that little place an' live on the fatta the lan' -an' rabbits?"
, "I... ain't gonna say nothin'. Jus' gonna stan' there."
, "O.k. -O.k. I'll tell ya again. I ain't got nothing to do. Might jus' as well spen' all my time tellin' you things and then you forget 'em, and I tell you again."
, "Lennie! Lennie, for God' sakes, don't drink so much."
);
</script>
</head>
<body>
<script type="text/javascript">
function GenerateQuote() {
var quotenumber=Math.random() * quotes.length;
quotenumber=Math.floor(quotenumber);
document.write(quotes[quotenumber]);
}
</script>
</body>
</html>

StevenHu
10-25-2012, 09:29 PM
As the rules and regulations say, we don't fix school projects. That's cheating.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum