...

View Full Version : Random content coding-confused



Caecilius
10-20-2003, 07:57 PM
ah hey hey.
I have been assigned the great duty of making a form website, but am having trouble with a random content script, can anyone point out what is wrong with this:
<script language="JavaScript">
<!--


function random_content(){
var mycontent=new Array()
//specify random content below.
mycontent[1]='<b><img src="hardial.jpg" width="150" height="150"> <br> Name: Hardial Kalsi <br>Occupation:<br>Often Heard Saying:blablabla</b>'
mycontent[2]='<b><img src="scully.jpg" width="150" height="150"> <br> Name: Niall Scully<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[3]='<b><img src="umar.jpg" width="150" height="150"> <br> Name: Umar Khan<br>Occupation:<br>Often Heard Saying:blablabla</b>'
mycontent[4]='<b><img src="joshj.jpg" width="150" height="150"> <br> Name:Joshua Johnson<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[5]='<b><img src="shuaib.jpg" width="150" height="150"> <br> Name: Shuaib Ahmed<br>Occupation:blablabla<br>Often Heard Saying:</b>'
mycontent[6]='<b><img src="amir.jpg" width="150" height="150"> <br> Name: Amir Hussain<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[7]='<b><img src="fender.jpg" width="150" height="150"> <br> Name:Thomas Fender<br>Occupation:<br>Often Heard Saying:blablabla</b>'
mycontent[8]='<b><img src="watts.jpg" width="150" height="150"> <br> Name: ThomasWatts<br>Occupation:Clever<br>Often Heard Saying:</b>'
mycontent[9]='<b><img src="josha.jpg" width="150" height="150"> <br> Name:Joshua Ainsworth<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[10]='<b><img src="jim.jpg" width="150" height="150"> <br> Name:James Edwards<br>Occupation:Self Hating ginger<br>Often Heard Saying:</b>'
mycontent[11]='<b><img src="russel.jpg" width="150" height="150"> <br> Name:Russel Cafferty<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[12]='<b><img src="tipper.jpg" width="150" height="150"> <br> Name:James Tipper<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[13]='<b><img src="matt.jpg" width="150" height="150"> <br> Name:Matthew Straughn<br>Occupation:<br>Often Heard Saying:blablabla</b>'
mycontent[14]='<b><img src="luke.jpg" width="150" height="150"> <br> Name: Luke Cragg<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[15]='<b><img src="askey.jpg" width="150" height="150"> <br> Name:Thomas Askey<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[16]='<b><img src="loren.jpg" width="150" height="150"> <br> Name: Loren Oakley<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[17]='<b><img src="joshscanedo.jpg" width="150" height="150"> <br> Name: Josh Seaton -on the left<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[18]='<b><img src="ng.jpg"width="150" height="150"> <br> Name: Jeffrey Ng<br>Occupation: <br>Often Heard Saying:</b>'



Many thanks, Caecilius

requestcode
10-20-2003, 08:21 PM
What trouble are you having? It looks like you did not post all of the script. Can you post the entire script r a link to the page. thankyou.

Caecilius
10-21-2003, 06:14 PM
http://www.anthologyofhatred.co.uk/index1.html

the content is just not appearing.
Ty for any help RC

Caecilius
10-25-2003, 07:39 PM
bump. anyone?

Willy Duitt
10-25-2003, 08:47 PM
Watch your punctuation.

Your single quotes used within the mycontent
array need to be escaped with a backslash \

<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]='<b><img src="hardial.jpg" width="150" height="150"> <br> Name: Hardial Kalsi <br>Occupation:Tall<br>Often Heard Saying:Anyone heard of that band, [underground band name here]</b>'
mycontent[2]='<b><img src="scully.jpg" width="150" height="150"> <br> Name: Niall Scully<br>Occupation:Irish<br>Often Heard Saying:That\\'s crap</b>'
mycontent[3]='<b><img src="umar.jpg" width="150" height="150"> <br> Name: Umar Khan<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[4]='<b><img src="joshj.jpg" width="150" height="150"> <br> Name:Joshua Johnson<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[5]='<b><img src="shuaib.jpg" width="150" height="150"> <br> Name: Shuaib Ahmed<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[6]='<b><img src="amir.jpg" width="150" height="150"> <br> Name: Amir Hussain<br>Occupation:Liker of Fender<br>Often Heard Saying:</b>'
mycontent[7]='<b><img src="fender.jpg" width="150" height="150"> <br> Name:Thomas Fender<br>Occupation:Fending<br>Often Heard Saying:naah man thats slack</b>'
mycontent[8]='<b><img src="watts.jpg" width="150" height="150"> <br> Name: ThomasWatts<br>Occupation:Clever<br>Often Heard Saying:</b>'
mycontent[9]='<b><img src="josha.jpg" width="150" height="150"> <br> Name:Joshua Ainsworth<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[10]='<b><img src="jim.jpg" width="150" height="150"> <br> Name:James Edwards<br>Occupation:Self Hating ginger<br>Often Heard Saying:</b>'
mycontent[11]='<b><img src="russel.jpg" width="150" height="150"> <br> Name:Russel Cafferty<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[12]='<b><img src="tipper.jpg" width="150" height="150"> <br> Name:James Tipper<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[13]='<b><img src="matt.jpg" width="150" height="150"> <br> Name:Matthew Straughn<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[14]='<b><img src="luke.jpg" width="150" height="150"> <br> Name: Luke Cragg<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[15]='<b><img src="askey.jpg" width="150" height="150"> <br> Name:Thomas Askey<br>Occupation:<br>Often Heard Saying:</b>'
mycontent[16]='<b><img src="loren.jpg" width="150" height="150"> <br> Name: Loren Oakley<br>Occupation:New<br>Often Heard Saying:Where is room x?</b>'
mycontent[17]='<b><img src="joshscanedo.jpg" width="150" height="150"> <br> Name: Josh Seaton -on the left<br>Occupation:<br>Often Heard Saying:Gil\\'Tay! (agility)</b>'
mycontent[18]='<b><img src="ng.jpg"width="150" height="150"> <br> Name: Jeffrey Ng<br>Occupation: Short<br>Often Heard Saying:Lay Say Poo Kai</b>'

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

.....Willy

Caecilius
10-26-2003, 03:37 PM
its about time superman stood down on his post, willy is my new hero



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum