View Full Version : Javascript not working properly in Safari & Chrome

06-18-2010, 03:18 AM
I have an "animated slideshow" of 29 jpeg images on a page created using Javascript. It works fine in Internet Explorer and Firefox but not Safari or Chrome. The jpeg files names are 01.jpg through to 29.jpg. Here below is the code in the header and the body. There is an error in there somewhere:

<title>My webpage</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<SCRIPT language="JavaScript" type="text/JavaScript">
var speed=1333;
var counter = 1;
function rollPics() {
document.display.src=counter+".jpg"; //Display image "counter".jpg
counter ++; // Add 1 to counter
if (counter>29) { // If counter is greater than 29 images then reset it
<!-- END -->

<IMG NAME="display" SRC="1.jpg" onLoad="setTimeout('rollPics()',1333)">

Philip M
06-18-2010, 09:19 AM
See:- http://www.codingforums.com/showthread.php?t=17515.
You will not get any reply in this forum which is intended to be used only to
post a completed (working) script for showcasing/benefit of others.

You should also study the forum posting guidelines, especially about double posting and the use of [code] tags.