S
Sez1
Hello.
I am trying to set up two rotating quotes on my web page.
I only have a pool of 20 quotes to start with, which I've saved
separately in .js files using document.write to include html formatting.
The two quotes appearing on the page obviously should not be duplicated;
but I'm not sure how to set it up.
I am setting up the variables that govern the quotes in a separate JS
file like this:
var quote1 = Math.random()*20;
quote1 = Math.round(quote1);
var quote2 = Math.random()*5;
quote2 = Math.round(quote2);
Can I simply add an IF statement to this, like:
IF (quote1==quote2 && quote1=20)
{quote1 = quote2-1}
ELSEIF (quote1==quote2 && quote1<20)
{quote1 = quote2+1}
THANKS FOR any pointers on this....
I am trying to set up two rotating quotes on my web page.
I only have a pool of 20 quotes to start with, which I've saved
separately in .js files using document.write to include html formatting.
The two quotes appearing on the page obviously should not be duplicated;
but I'm not sure how to set it up.
I am setting up the variables that govern the quotes in a separate JS
file like this:
var quote1 = Math.random()*20;
quote1 = Math.round(quote1);
var quote2 = Math.random()*5;
quote2 = Math.round(quote2);
Can I simply add an IF statement to this, like:
IF (quote1==quote2 && quote1=20)
{quote1 = quote2-1}
ELSEIF (quote1==quote2 && quote1<20)
{quote1 = quote2+1}
THANKS FOR any pointers on this....