Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q755 Can an image be replaced by a Java applet?

irt.org | Knowledge Base | JavaScript | Java | Q755 [ previous next ]

Q755 Can an image be replaced by a Java applet?

Only in Netscape Navigator 4 and Internet Explorer 4 with the aid of DHMTL:

First the trigger:

<FORM><INPUT TYPE="BUTTON" VALUE="Click Here" onClick="trigger()"></FORM>

or:

<SCRIPT LANGUAGE="JavaScript"><!--
setTimeout('trigger()',10000); // 10 second delay
//--></SCRIPT>

Then the JavaScript and HTML:

<P>
<SCRIPT LANGUAGE="JavaScript"><!--
function trigger() {
    var text = '<APPLET...></APPLET>';
    if (document.all)
        document.all.myDiv.innerHTML = text;
    else if (document.layers) {
        document.layers['myLayer'].document.open();
        document.layers['myLayer'].document.write(text);
        document.layers['myLayer'].document.close();
    }
}
//--></SCRIPT>

<P>
<DIV ID="myDiv">
<LAYER ID="myLayer">
<IMG SRC="image.gif">
</LAYER>
</DIV>
</P>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.