PDA

View Full Version : Works fine in Firefox, script Error in IE - please help



BeginnersLuck
03-18-2009, 02:34 PM
Hi guys,

I'm designing my own website at the moment, it's very basic so I wanted to add some dynamic aspects to brighten it up. I designed it in dreamweaver and it seems to work fine on my browser (Firefox). I didn't test for cross browser compatibility though and it seems that the page doesn't load in Internet Explorer. Just a blank screen and a popup that says:

Line: 27
Char: 3
Error: 'document.slide' is null or not an object
Code: 0

I imported the script into the html from a library resource site, and as I have no knowledge of the proper syntax for javascript I was wondering if anyone here could please take a look at the site and offer any suggestions in combatting this problem.


The site is here (http://www.byrnemonumentalworks.com)

Thanks in advance.

riffla
03-20-2009, 10:17 AM
Hi

What version of IE are you running?
Works for me using IE 7.0, no script error at all

/Rickard

codeexploiter
03-21-2009, 09:52 AM
In IE6 also unable to find the mentioned issue.

jscheuer1
03-21-2009, 12:47 PM
I too am getting no error. But it is possible, that if the page is slow in loading that document.slide will not be available in time. To remedy that, you could alter the script, or better yet - just move it until after document.slide (the image tag):


. . . menu=="yes" && document.getElementById)
window.onunload=savemenustate

</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#000000" colspan="3">
<div align="center"><img src="header.gif" width="647" height="145"></div>
</td>
</tr>
<tr>
<td bgcolor="#000000" colspan="3">
<div align="center">
<P ALIGN=center><img src="image1.gif" name="slide"></P>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
gSlideshowInterval = 3;
gNumberOfImages = 6;

gImages = new Array(gNumberOfImages);
gImages[0] = "image1.gif";
gImages[1] = "image2.gif";
gImages[2] = "image3.gif";
gImages[3] = "image4.gif";
gImages[4] = "image5.gif";
gImages[5] = "image6.gif";

function canManipulateImages() {
if (document.images)
return true;
else
return false;
}
function loadSlide(imageURL) {
if (gImageCapableBrowser) {
document.slide.src = imageURL;
return false;
}
else {
return true;
}
}
function nextSlide() {
gCurrentImage = (gCurrentImage + 1) % gNumberOfImages;
loadSlide(gImages[gCurrentImage]);
}
gImageCapableBrowser = canManipulateImages();
gCurrentImage = 0;
setInterval("nextSlide()",gSlideshowInterval * 1000);
// -->
</SCRIPT>
</div>
</td>
</tr>
<tr>
<td bgcolor="#0000 . . .