I found a java script that allow for a new image to load on refresh from a series of images. It works fine in IE and Firefox, however in Safari when I hit refresh the page goes blank. The image is the first thing to load on the page. Also, if I do not delete this line of code: <script language=”JavaScript”>, then I get an error in Dreamweaver. I will warn you that I don’t know much about this stuff. Any suggestions would be appreciated.
[url]http://studentaccess.emporia.edu/~jdecker/website1/index.html
Here is the script:
<!– TWO STEPS TO INSTALL RANDOM IMAGE SCRIPT:
1. Copy the coding into the HEAD of your HTML document2. Add the last code into the BODY of your HTML document –>
<!– STEP ONE: Paste this code into the HEAD of your HTML document –>
<HEAD>
<!– This script and many more are available free online at –>
<!– The JavaScript Source!! [url]http://javascript.internet.com
<!– Original: jsCode.com –>
<!– Web Site: [url]http://jscode.com
<script language=”JavaScript”>
<!–
// ==============================================
// Copyright 2003 by jsCode.com
// Source: jsCode.com
// Author: etLux
// Free for all; but please leave in the header.
// ==============================================
// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array. Rememeber
// to increment the theImages[x] index!
theImages[0] = ‘100.jpg’
theImages[1] = ‘200.jpg’
theImages[2] = ‘300.jpg’
theImages[3] = ‘400.jpg’
theImages[4] = ‘500.jpg’
// ======================================
// do not change anything below this line
// ======================================
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write(‘<img src=”‘+theImages[whichImage]+'”>’);
}
//–>
</script>
</HEAD>
<!– STEP TWO: Copy this code into the BODY of your HTML document –>
<BODY>
<!– This script and many more are available free online at –>
<!– The JavaScript Source!! [url]http://javascript.internet.com
<!– Original: jsCode.com –>
<!– Web Site: [url]http://jscode.com
<script language=”JavaScript”>
<!–
showImage();
//–>
</script>
<p><center>
<font face=”arial, helvetica” size”-2″>Free JavaScripts provided<br>
by <a href=”http://javascriptsource.com”>The JavaScript Source</a></font>
</center><p>
<!– Script Size: 2.02 KB –>