Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Random Quote Generator

    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>

  • #2
    Regular Coder
    Join Date
    Jun 2011
    Location
    CA
    Posts
    105
    Thanks
    0
    Thanked 10 Times in 10 Posts
    As the rules and regulations say, we don't fix school projects. That's cheating.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •