Click to See Complete Forum and Search --> : DHTML Javascript Error -- Help for Newbie?


sher07
05-28-2003, 03:31 PM
Dear friends:

I'd appreciate your help with the following problem.

Using FrontPage (without the FP Extensions), II am designing an art
history site at:

http://www.websher.net/extra/test/masters/

Tto do this I downloaded the FlexiSlide DHTML javascript slide show (for IE
and NS6) from Dynamic Drive at:

http://www.dynamicdrive.com/dynamicindex14/flexislide.htm

Due to the fact that this script is free, no technical support is
provided for it. Now here is the strange part. In spite of an error message that appears in FP when I try to see the home
page in Preview mode, the script works when I view it online, i.e.
after uploading it to my web site. It works fine on MY computer (in
IE6, NS7 and Opera 7 (but online from my website, NOT from my own
computer), but it does NOT work on my wife's computer. The browser
selection is IE 4+ and Netscape 4+. The slide show runs through all
ten images online on my computer but on her computer it says in IE
(and Netscape and Opera): "Done but with errors". But the script never
gets past the first image.

The error message says:
INTERNET EXPLORER ERROR MESSAGE

An error has occurred in the script on this page.

Line: 127
Character: 1
Error: Object expected:
Code: 0
URL: file://C:\Documents and Settings\Sher\Local Settings\Temporary
Internet Files\Content.IE5\CVRNU4P5\[1].htm
(The last part, i.e. the specific URL always changes.

The specific object that is expected is always the same: it is
"if (ie||dom)" (without the quotes). Here is the actual context:

if (ie||dom)
document.write('<div id="slidedom"
style="width:'+slidewidth+';height:'+slideheight+';
background-color:'+slidebgcolor+'"></div>')

This error is also present in the original script. When I added the
original script to a blank page in FP, produced the exact same error
message.

On the other hand, when I placed this same script in Namo 5.5, I got
the exact same error message but the guilty line was indicated
elsewehre, namely:

XWYTimeout("rotateimages()",slidedelay)

Hre is the context for this line:

else if (ie||dom)
crossrotateobj.innerHTML=contentcontainer
if (currentslide==variableslide.length-1) currentslide=0
else currentslide++
XWYTimeout("rotateimages()",slidedelay)
}

if (ie||dom)
document.write('<div id="slidedom"
style="width:'+slidewidth+';height:'+slideheight+';
background-color:'+slidebgcolor+'"></div>')


Is there any way to salvage this script. It's ideal for my needs, but
I am afraid this is, at the moment, at least, way over me to deal
with. My first question is: is this script defective? Secondly, if
not, is there an easy way to fix it?

Thank you all so very much.

Benjamin
sher07@mindspring.com

Jona
05-29-2003, 10:36 AM
The error is on this line:


XWYTimeout("rotateimages()",slidedelay)


This error is: "Object Expected," because there is no function (or method) known as XWYTimeout(), and the browser cannot find any function with that name, so it causes an error. Replace that line with the setTimeout() method of the window object:


setTimeout("rotateimages()",slidedelay);

sher07
05-29-2003, 01:27 PM
Dear Jona:

My eternal gratitude! I just tried it and, lo and behold, you are right. No more error messages. Thanks a million.

Benjamin

Jona
05-29-2003, 01:32 PM
You're quite welcome, my friend. ;)

Jona