Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder Bengal313's Avatar
    Join Date
    Jun 2002
    Metro Detroit
    Thanked 0 Times in 0 Posts

    Alternating html code?

    I have a page that has a current news in a small table AND a weather ticker in another. This is created by some javascript. What I want to do is put some javascripting in it that would allow for the 2, to alternate on reload. The would load on the same spot on the page. Thanx

    Something like this maybe.

    A javascript that says on refresh alternate between

    [set of html codes 1]
    [set of html codes 2] //html codes contain javascript as well
    Last edited by Bengal313; 01-31-2005 at 10:07 PM.
    "Knowledge Speaks But Wisdom Listens"

  • #2
    New Coder
    Join Date
    Jan 2005
    Thanked 0 Times in 0 Posts
    You want to try putting the two sets in an array and then OnLoad telling the Javascript to choose one value. So like this:

    new Array ( "set of html codes 1, set of HTML codes 2", "set of HTML codes 2, set of HTML codes 1")

    Unfortunately I don't know how to pick a random value from an array, so you'll have to find that out yourself .
    Congratulations on discovering the hidden sig! Click here to claim your prize!


    Posting Permissions

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