Help - Search - Members - Calendar
Full Version: Conflicting Javasript statements
HTMLHelp Forums > Programming > Client-side Scripting
firefly
Hi,

I need some advice please: my site www.fireflyweb.co.za/services.html has two conflicting Javascript statements.
One is for a clock and the other is for a slideshow. The statement in question is 'setTimeout'. On Firefox the slideshow works and on IE the clock works. How can I make both functions work on both browsers?

Thanks a million.
Christian J
Several setTimeout methods should be able to work on the same page. But you call the clock with

CODE
window.onload = theClock


and the slideshow with

CODE
<body onLoad="slideShow(0)">

that conflict with each other. Instead try

CODE
<body onLoad="slideShow(0); theClock();">


Sidenotes: Before the page has finished loading, the clock shows the text "theClock". The slideshow occasionally shows identical pictures side by side.
firefly
Hi,
Thanks alot for the quick response!
The solution: <body onLoad="slideShow(0); theClock();"> works perfectly in Firefox but doesn't seem to do anything in IE. Any more advice would be greatly appreciated!

Thanks.
Christian J
Seems to work in my IE7. Did you remove the window.onload = theClock line in the script?

There are also many validator errors. A few (not all) of them will go away if you use a HTML4 Doctype instead of XHTML.
firefly
Works perfectly!

Thanks- your a lifesaver!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.