Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q755 Can an image be replaced by a Java applet?

You are here: irt.org | FAQ | JavaScript | Java | Q755 [ previous next ]

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>

©2018 Martin Webb