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
    Dec 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I just don't get Javascript

    First, I want to say that my textbook doesn't explain jack ****.
    I have an assignment in my HTML class that requires me to use javascript. One line says:
    "declare a variable named 'rNum' which is equal to a random integer between 1 and the value of the size variable"

    I have no idea what I'm supposed to do in order to achieve this. I am completely lost and starting to hate the person who wrote my textbook. Can anyone help?

  • #2
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's tricky to help without telling the answer so I'll just point to some webpages that should help.

    To declare a variable:

    http://www.w3schools.com/js/js_variables.asp

    To get a random integer:

    http://www.pageresource.com/jscript/jrandom.htm

    Hopefully those are better than your book

    david_kw


  •  

    Posting Permissions

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