Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

IE 3.02 error, Undefined line 33

Posted on 1997-11-02
2
Medium Priority
?
177 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 200 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

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…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one 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…

877 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