Solved

IE 3.02 error, Undefined line 33

Posted on 1997-11-02
2
151 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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

771 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

11 Experts available now in Live!

Get 1:1 Help Now