odd slideshow problem (fine in IE, not in Mozilla)

This is a discussion on "odd slideshow problem (fine in IE, not in Mozilla)" within the JavaScript Forum section. This forum, and the thread "odd slideshow problem (fine in IE, not in Mozilla) are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 15th, 2005, 23:47
Junior Member
Join Date: Jan 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
odd slideshow problem (fine in IE, not in Mozilla)

Hi guys,

I am currently developing a js slideshow. I have uploaded the page to the following URL, so hopefuly you can help me out.
http://www.freewaymedical.co.uk/prot...testonWeb.html

Please go here and view source to troubleshoot.

It does take a while to load as I have lots of mods to make before the live version. Your patience here is appreciated.

The problem is that the code works fine in IE6, that is all the slideshows work. However when I load it up in any other browser (have actually tried Mozilla, Firefox and Netscape. All latest versions) the first slideshow does not seem to change the image, but the other 4 slideshows work fine??

I can't understand it as I generate the code dynamically with PHP and js, so in theory they should all work the same.

I have opened the file with Mozilla's javascript debugger (Venkman) and stepped through it. It seems to just exit the following function on the part marked <!--exits here->> without executing it or the following lines. This is really confusing as there is no error message or exception raised, it just stops executing the function.

Stepping through this on any of the other slideshows executes all lines as expected.

Code: Select all
function slideshowUp(n)
{
		switch(n)
        {
			case 'char': 	{charnum++}; break
			case 'room':   	{roomnum++};break
			case 'stor':   	{stornum++}; break
			case 'vari':   	{varinum++}; break
			case 'resu':   	{resunum++}; break
			default: alert("an error has occurred, please refresh the page and try again");         
        }
var determineImg="if ("+n+"num=="+n+"NumMax){"+n+"num=min}";
eval(determineImg);
var newImage="document."+n+".src="+n+"Pics["+n+"num].src";
//get the new width
var newHeight=resizeGetSize(n, "h");
//get the new height
var newWidth=resizeGetSize(n, "w");
//document.char.height=newHeight
<!--exits here 
eval("document."+n+".height="+newHeight);
->>
eval("document."+n+".width="+newWidth);
eval(newImage);
Please help as I am completely stumped!

  #2 (permalink)  
Old Mar 16th, 2005, 01:38
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
for your info jono, html in your signature wont work. Please use BBCode
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #3 (permalink)  
Old Mar 16th, 2005, 06:47
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
"char" is a reserved word in javascript. Change that to something else like "chrt"
  #4 (permalink)  
Old Mar 16th, 2005, 08:02
Junior Member
Join Date: Jan 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
I am not home at the moment to test this, but will do so straight away tonight!

Does that make sense then that it would work fine in IE but not all other browsers?

Thanks for the help-I had really run out of ideas!
  #5 (permalink)  
Old Mar 16th, 2005, 08:11
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
IE is often more forgiving of errors in jscript.
  #6 (permalink)  
Old Mar 16th, 2005, 11:47
Junior Member
Join Date: Jan 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
also, when the page loads for the first tim,e when the images are not cached, the initial slideshow images do not show. However, when I refresh they seem to appear.

Would this be down to the use of char as well?
  #7 (permalink)  
Old Mar 17th, 2005, 08:08
Junior Member
Join Date: Jan 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Changed the 'char' image name and all works fine now in Mozilla, Firefox, Netscape and IE.

Also resolved the problem of the first image not showing by setting them at body onload.

Thanks for your help with this issue!
  #8 (permalink)  
Old Mar 17th, 2005, 08:42
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
You're welcome. Reserved word use is one of the hardest things to track down.
Closed Thread

Tags
odd, slideshow, problem, fine, mozilla

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem Seeing Image In Mozilla Geeky Girl Graphics and 3D 10 Mar 23rd, 2008 01:21
[SOLVED] Another problem with mozilla thewebkid Web Page Design 12 Nov 29th, 2007 14:39
Unable to disable text(label) in javascript,working fine with IE, not with MOZILLA balaji JavaScript Forum 1 Jul 11th, 2007 09:55
Problem with image in Mozilla ?? please help DavidinLondon JavaScript Forum 1 May 20th, 2006 16:03
IE/Mozilla problem crip Web Page Design 1 Feb 12th, 2004 18:33


All times are GMT. The time now is 10:27.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43