View Full Version : javascript error thing


J E P P O
05-09-2003, 11:30 PM
ok, heres the deal,

I wanna insert this random javascript thing:

<script language="JavaScript">
<!--

/*
Random Content Script- By JavaScript Kit(http://www.javascriptkit.com)
Over 200+ free JavaScripts here!
*/

function random_content(){
var mycontent=new Array()
//specify random content below.
mycontent[1]='Make it idiot proof and someone will make a better idiot.'
mycontent[2]='Always remember you're unique, just like everyone else.'
mycontent[3]='SMILE...If you're not wearing any underwear!!'
mycontent[4]='I used to have a handle on life, then it broke.'
mycontent[5]='Bother, said Pooh as the brakes went out.'
mycontent[6]='Ever notice how fast Windows runs? Neither did I.'
mycontent[7]='The Computer said insert disk 3. But I could only fit 2.'
mycontent[8]='Change is inevitable, except from a vending machine.'
mycontent[8]='He who laughs last thinks slowest!'

var ry=Math.floor(Math.random()*mycontent.length)
if (ry==0)
ry=1
document.write(mycontent[ry])
}
random_content()
//-->
</script>

to this (http://www34.brinkster.com/dimrealisation/) page but every time i do, I get a white screen.

I want to insert it just below the logo...any reasons?? or solutions??

thanks,

Chris

starlet
05-10-2003, 12:02 AM
1. you have two parts named [8] the second needs changeing to [9] obviously...

mycontent[8]='Change is inevitable, except from a vending machine.'
mycontent[8]='He who laughs last thinks slowest!'

2. You shouldnt have any ' <-- of those other than at the start and end of the quotes, you have a couple in the words you're in a few of the quotes.

I havnt tested it out so i dont know if fixing those will fix it or not, but its worth a go :)

J E P P O
05-10-2003, 12:06 AM
YOU DID IT. I saw both those mistakes changed th <!-- things first then pt them bak a changed the 8 to 9 but i didn't think about puttin em together. THANKYOU SOOOOOOOOO MUCH!