View Full Version : Alternating html code?

01-31-2005, 09:43 PM
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

02-01-2005, 05:44 PM
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 :) .

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum