Solved

IE 3.02 error, Undefined line 33

Posted on 1997-11-02
2
172 Views
Last Modified: 2012-05-04
This script works in Netscape 3.0 and IE 4.0 but errors in IE 3.0
It claims an undefined variable with the load image () statment.

<SCRIPT LANGUAGE="JavaScript1.1">
<!-- Hide script
var Inc=0;
var Max=4;



var ImageArray = new Array();
ImageArray[1] = new Image();
ImageArray[1].src = "Image1.gif";
ImageArray[2] = new Image();
ImageArray[2].src = "Image2.gif";
ImageArray[3] = new Image();
ImageArray[3].src = "Image3.gif";
ImageArray[4] = new Image();
ImageArray[4].src = "Image4.gif";


function LoadImage()
{
    Inc++;
    if (Inc > Max) {
      Inc=1;
    }
    document.STUFF.src=ImageArray[Inc].src;
    setTimeout("LoadImage()",8000);            


}
// -->
</SCRIPT>
</HEAD><BODY onload="LoadImage();">

<img src="Image2.gif" width="468" height="60" name="STUFF">


</BODY></HTML>
0
Comment
Question by:csart
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
Holger101497 earned 50 total points
ID: 1272307
Internet Explorer 3.0 is NOT compatible with Netscape Navigator 3.0, it is compatible with Netscape 2.0!!! (it even admits that in the navigator.appVersion)
userAgent=Mozilla/2.0 (compatible; MSIE 3.02; Update a; Windows NT)
appVersion=2.0 (compatible; MSIE 3.02; Update a; Windows NT)

Therefore, it does not implement "JavaScript1.1" and completely ignores your code. When onload tries to call LoadImage(), the function is not defined.

There is really nothing you can do to make your code work in IE3, because the Image-object is not implemented. By adding:
<script language="JavaScript">
  function LoadImage() {}
</script>
IN FRONT of your other code, the page will load without errors, but of course, it won't do what you want it to do!

sorry for the bad news, but of all the people trying to replace images in IE3, I don't know anybody who has done it (well, there are workarounds that involve frames, reloading the page or the <iframe> tag if it is absolutely necessary, but they tend to be rather ugly!)
0
 

Author Comment

by:csart
ID: 1272308
I do Not wish to use a frames page hack. However what about the possibility of loading a diferant image if the user hits a back button from a link? (Of corse this should be tied to a browser detect script and only execute for IE3.)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question