JavaScripting problem

admin

Administrator
Staff member
Hello..I need some assistance with Javascripting.

I amanged to compile code that would allow random sayings to be displayed on my page evertime the page is refreshed.

I used notepad to write the code then copied and pasted it into the HTML code where I wanted it to appear.

Problem is it won't work and I am sure I have it right but I am not sure...here is the code I compiled:

<html>
<head>
<body>
<script language="javascript">
QuoteArray = new Array(
"Life is like the game of chess, when it is all over the kings and pawns all go back in the same box",
"I felt like working but after I sat down and had some coffee the feeling soon dissappeared",
"I like swords",
"If you're gonna get mad every time I do something stupid then I guess I'll just have to stop doing stupid things!",
"MWAA-HAHAHAHAHAHAHAHAHAHAHA......",
"There is only one way out and it is being blocked by cannibalistic lawyers.",
"D'oh!",
"I've fallen and I can't get up.",
"Are you sick of these quotes yet?",
"Please, I wanna be a clone now.",
"..........",
"Todays Tip: Don't eat lead!"):
RandomNo = Math.floor(QuoteArray.length * Math.random());
document.write("<b>" + QuoteArray[RandomNo] + "</b>");
</script>
</body>
</html>

Is this right or did I miss something...any help you could lend me would be greatly appreciated.

:D
 
Back
Top