Works with Netscape; not IE

K

kaeli

This JavaScript slideshow works with Netwcape; not IE. Is there some
obvious that is missing?

http://209.204.172.137/slideshow/slideshow.html

Todd

Jeez, takes a long time to load. And I have broadband...

Anyways, for some reason, the server dies with IE. I looked at the
source, and all I saw was this.

<html>
<head>
<title>Slide show</title>
<script language="JavaScript">
<!--
var interval = 1500;
var random_display = 0;
var imageDir = "images/";
var imageNum = 0;imageArray = new Array();
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5885.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5895.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5899.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5901.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5903.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5906.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5907.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5913.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5915.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5917.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5921.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5923.jpg");
imageArray[imageNum++] = new imageItem(imageDir + "dsc_5928.jpg");
imageArray[imageNum++] = new imageItem(image

That's where it stops.
So, you might want to check your server configs and log files.

--
 
T

Todd Cary

Dennis -

I am very new to JavaScript, so I just copied some javaScript and made a
few mods. How can I get around the pre-loading? Any help you can lend
is greatly appreciated.

Todd
 
F

Frank Carr

I am very new to JavaScript, so I just copied some javaScript and made a
few mods. How can I get around the pre-loading? Any help you can lend
is greatly appreciated.

Here's a little snippet from a page of mine...

function ShowPicture(nID)
{
document.getElementById('imgShow').width = arPictures[nID][3];
document.getElementById('imgShow').height = arPictures[nID][4];
document.getElementById('imgShow').src="images/" + arPictures[nID][1];
}

This loads the picture dynamically into the image when the user clicks on a
link that calls this function (inserted on load from element #2 in the
array). If all of your pictures are the same size you won't have to set the
image width/height. All that's preloaded is a javascript array with the
picture definitions (about 5-7k).
 
T

Todd Cary

Frank -

Would you have any sample code that I could look at so that I can
understand how to just store the location of the images rather than the
images themselves?

I got IE working...had to clear the cache and toggle the security settings.

Here is a smaller SlideShow, but it is still storing the image; not just
the location.

http://209.204.172.137/slideshow/slideshow_small.html


Todd

Frank said:
I am very new to JavaScript, so I just copied some javaScript and made a
few mods. How can I get around the pre-loading? Any help you can lend
is greatly appreciated.


Here's a little snippet from a page of mine...

function ShowPicture(nID)
{
document.getElementById('imgShow').width = arPictures[nID][3];
document.getElementById('imgShow').height = arPictures[nID][4];
document.getElementById('imgShow').src="images/" + arPictures[nID][1];
}

This loads the picture dynamically into the image when the user clicks on a
link that calls this function (inserted on load from element #2 in the
array). If all of your pictures are the same size you won't have to set the
image width/height. All that's preloaded is a javascript array with the
picture definitions (about 5-7k).
 
T

Todd Cary

I figured it out...

No caching of images now....

http://209.204.172.137/slideshow/slideshow_x.html

Todd

Frank said:
I am very new to JavaScript, so I just copied some javaScript and made a
few mods. How can I get around the pre-loading? Any help you can lend
is greatly appreciated.


Here's a little snippet from a page of mine...

function ShowPicture(nID)
{
document.getElementById('imgShow').width = arPictures[nID][3];
document.getElementById('imgShow').height = arPictures[nID][4];
document.getElementById('imgShow').src="images/" + arPictures[nID][1];
}

This loads the picture dynamically into the image when the user clicks on a
link that calls this function (inserted on load from element #2 in the
array). If all of your pictures are the same size you won't have to set the
image width/height. All that's preloaded is a javascript array with the
picture definitions (about 5-7k).
 
T

Thomas 'PointedEars' Lahn

Frank said:

Please shorten your attribution. Omitting superfluous information
like the message-ID makes it only an attribution _line_ which eases
reading of discussions and makes it worse otherwise.
I am very new to JavaScript, so I just copied some javaScript and made a
few mods. How can I get around the pre-loading? Any help you can lend
is greatly appreciated.

Here's a little snippet from a page of mine...

function ShowPicture(nID)
{
document.getElementById('imgShow').width = arPictures[nID][3];
document.getElementById('imgShow').height = arPictures[nID][4];
document.getElementById('imgShow').src="images/" + arPictures[nID][1];
}

The above is highly inefficient, error-catching, bad style and thus
not to be recommended at all.

Zeroth, it is bad style since you directly refer to global variables
(`arPictures').

First, document.getElementById(...) is a method of the W3C-DOM.
You do not check for its support which is error-catching:

http://pointedears.de.vu/scripts/test/whatami

Second, it is more efficient to retrieve the reference once and
use it (several times) afterwards *if* it is _valid_:

if (document.getElementById)
{
var o = document.getElementBid(...);
if (o)
{
o.width = ...;
o.height = ...;
o.src = ...;
}
}

Third, user agents who support the document.getElementById(...)
method of W3C-DOM Level 2 also support its document.images[...]
collection and accessing it is even more efficient. More, the
collection is also backwards compatible as it is part of the
so-called "DOM Level 0" originating from Netscape Navigator 3.0
and Internet Explorer 3.0:

if (document.images)
{
var o = document.images[...];
if (o)
{
// ...
}
}

See

http://www.w3.org/TR/DOM-Level-2-HTML/

for details and consider (using) the source code of

http://pointedears.de.vu/scripts/test/hoverMe/

instead.


HTH

PointedEars
 
F

Frank Carr

Please shorten your attribution.

After 1000's and 1000's of message posted in many newsgroups over many years
you're the first to mention anything like this. Hmmm.....is this group more
about nitpicking than actually helping people? Given your nasty little
response and others I've seen here, I guess so...My bad...
 
T

Thomas 'PointedEars' Lahn

Frank said:
Please shorten your attribution.

After 1000's and 1000's of message posted in many newsgroups over many years
you're the first to mention anything like this. Hmmm.....is this group more
about nitpicking than actually helping people? Given your nasty little
response [...]

Obviously you have not read all of my posting or are too stupid to
understand it. Obviously you are not worth to receive more of my
advice. FOAD. *PLONK*


PointedEars
 
D

Dr John Stockton

JRS: In article <[email protected]>, seen in
Thomas 'PointedEars' Lahn
Please shorten your attribution. Omitting superfluous information
like the message-ID makes it only an attribution _line_ which eases
reading of discussions and makes it worse otherwise.

Ignore that - he is a wannabe Mussolini, and there is no such convention
in News. See below.

In subsequent handling, the body of a news article may be saved outside
News; it should be adequately self-descriptive.

Obviously, though, for consistent he should remove his pointed ears, and
remain content with the name apparently bestowed on him at birth.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,159
Latest member
SweetCalmCBDGummies
Top