INFO: Internet Explorer 3.x Has No Built-In Image Object |
Q173887
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.
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:
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.Microsoft JScript runtime error
[Line: 7] 'document.Form1.Picture.src' is not an object
Additional query words: kbDSupport kbdsi
Keywords :
Issue type : kbinfo
Technology : kbIEsearch kbAudDeveloper kbSDKIESearch kbSDKIE300 kbSDKIE301 kbSDKIE302
|
Last Reviewed: September 1, 1999 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |