Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

IE 3.02 error, Undefined line 33

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

719 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