ok I got this from Tom Negrino's book , "Javascript for the world wide
web 2 edition"
I downloaded it, (script 3.7) off their website
http://www.chalcedony.com/javascript.../scriptsf.html
The script is used to display a random image whenever someone enters
your website.
I adjusted the script to fit my needs. my webpage uses css and is
written in xhtml, this may be the problem, Anyhow it doesnt work. what
have I done wrong?
Thanks Melanie
<SCRIPT LANGUAGE=JAVASCRIPT>
<!-- Hide script from old browsers
// This script copyright 1997, Tom Negrino and Dori Smith.
// This script is from "JavaScript for the WWW, Visual QuickStart
Guide, 2nd Ed."
// For more information, see <http://www.chalcedony.com/javascript/>.
// This script may be used and modified, but the copyright notice
must remain intact.
var r1 = new Array(26)"http://www3.telus.net/mjw/r1/1.jpg",
"http://www3.telus.net/mjw/r1/10.jpg",
"http://www3.telus.net/mjw/r1/11.jpg",
"http://www3.telus.net/mjw/r1/2.jpg",
"http://www3.telus.net/mjw/r1/22.jpg",
"http://www3.telus.net/mjw/r1/3.jpg",
"http://www3.telus.net/mjw/r1/33.jpg",
"http://www3.telus.net/mjw/r1/4.jpg",
"http://www3.telus.net/mjw/r1/44.jpg",
"http://www3.telus.net/mjw/r1/5.jpg",
"http://www3.telus.net/mjw/r1/55.jpg",
"http://www3.telus.net/mjw/r1/6.jpg",
"http://www3.telus.net/mjw/r1/7.jpg"
"http://www3.telus.net/mjw/r1/8.jpg",
"http://www3.telus.net/mjw/r1/9.jpg",
"http://www3.telus.net/mjw/r1/dec3.jpg",
"http://www3.telus.net/mjw/r1/dp.jpg",
"http://www3.telus.net/mjw/r1/frozenwaterfall.jpg",
"http://www3.telus.net/mjw/r1/house.jpg",
"http://www3.telus.net/mjw/r1/house01.jpg",
"http://www3.telus.net/mjw/r1/imageo114.jpg",
"http://www3.telus.net/mjw/r1/pine.jpg",
"http://www3.telus.net/mjw/r1/pineriver.jpg",
"http://www3.telus.net/mjw/r1/pineriverbridge.jpg",
"http://www3.telus.net/mjw/r1/tree.jpg",
"http://www3.telus.net/mjw/r1/wf.jpg"
function choosePic() {
if (document.images) {
randomNum = Math.floor((Math.random()*10)) % 3
document.mypicture.src = r1[randomNum]
}
}
// End hiding script from old browsers -->
</SCRIPT>
<BODY BGCOLOR="WHITE" onload="choosePic()">
<IMG SRC="http://www3.telus.net/mjw/r1/dec3.jpg" WIDTH="200"
HEIGHT="135" NAME="myPicture" align="right";">