Results 1 to 4 of 4

Thread: Works fine in Firefox, script Error in IE - please help

  1. #1
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Works fine in Firefox, script Error in IE - please help

    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

    Thanks in advance.

  2. #2
    Join Date
    Mar 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi

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

    /Rickard

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    In IE6 also unable to find the mentioned issue.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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):

    Code:
     . . . 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 . . .
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •