INFO: Internet Explorer 3.x Has No Built-In Image Object

ID: Q173887

The information in this article applies to:

SUMMARY

Internet Explorer 4.0 and a third-party browser provide a built in Image object for displaying images that allows changing the displayed image on- the-fly by changing the Image object's Src attribute in script. Internet Explorer 3.x does not provide an Image object and therefore does not support dynamically changing the Src attribute.

MORE INFORMATION

The following sample HTML page demonstrates the issue in Internet Explorer 3.x:

   <HTML>
   <HEAD>
   <TITLE>Changing Image</TITLE>
   <SCRIPT LANGUAGE="JavaScript" >

   function change()  {
      if ( document.Form1.Picture.src=="two.gif" )  {
         document.Form1.Picture.src="one.gif";  }
      else  {
         document.Form1.Picture.src="two.gif";   }
   }

   </SCRIPT>
   </HEAD>
   <BODY>
   <FORM NAME="Form1">
   <IMG NAME="Picture" SRC="one.gif" ><BR><BR>
   <INPUT NAME="Control" TYPE=BUTTON  VALUE="Change Image"
     onClick="change();" >
   </FORM>
   </BODY>
  </HTML>

If a users tries to run this page in Internet Explorer 3.x the following error occurs:

   Microsoft JScript runtime error

   [Line: 7] 'document.Form1.Picture.src' is not an object

This is by design in Internet Explorer 3.x. Internet Explorer 4.0 provides an Image object, supporting the functionality in the above sample HTML page.

Additional query words: kbDSupport kbdsi

Keywords          : vbObjMdIIE vbObjMdlIE 
Version           : WINDOWS:3.0,3.01,3.02
Platform          : WINDOWS
Issue type        : kbinfo

Last Reviewed: May 30, 1998