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 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help with Random Html

    Ok i made this code as a news thing for my website


    <SCRIPT LANGUAGE="JavaScript">

    var randomness = new Array(4)
    randomness[0] = 'Soul P. Signs With Beatmart.<br><a href="http://www.beatmart.com/site.php?em576=57753_0__0_~0_-1_5_2006_0_0&content=news">Click Here To Read More</a>';
    randomness[1] = 'KJ-52 Has an Official Myspace Page "No Joke Its From the man himself"<br> <a href="www.myspace.com/kj52">Click Here To See</a>';
    randomness[2] = 'Trip Lee to release debut album May 30th<br><a href="http://reachrecords.com/artists.php?id=3&sID=42">Click Here For More Info</a>';
    randomness[3] = 'The Cross Movement To Realese Chronicles (Greatest Hits, Vol. 1) Aug. 22, 2006<br><a href="http://www.crossmovementrecords.com/articles_view.asp?articleid=21726&columnid=1089">Click Here For More Info</a>';

    var a = Math.floor(Math.random() * randomness.length)

    document.write(randomness[a]);

    </SCRIPT>


    When i tested it it would start with one line of news but when i reloaded it it would put two lines of news. What is wrong with this?
    Last edited by RIKaSHaY7486; 05-07-2006 at 04:22 AM.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,016
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Works fine for me in IE5.5.

  • #3
    New Coder
    Join Date
    Mar 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Really well i use firefox, or maybe it could be the testing board i use. I use Zoicks html practice


  •  

    Posting Permissions

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