Solved

IE 3.02 error, Undefined line 33

Posted on 1997-11-02
2
157 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

896 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now