2

I am trying to load an applet on demand via javascript.

Here is what I've tried:

function startApplet() {
    document.write('<applet code="com.pwc.envoyapp.applet.SampleApplet" height=30 width=40 archive="ucfapplet.jar"></applet>');
}

The problem is that it loads the applet in a new page. I need it to open it on the same page so that session keys generated by the applet are preserved.

Is there a way to get the applet to load on the same page?

1
  • I presume you have already rejected deployJava.js because that script writes directly to the page, ruling it out for 'on demand'. It is a major (& irritating) failing of an otherwise good script. :( Commented Oct 4, 2011 at 16:59

1 Answer 1

1

have you tried something like:

document.getElementById("appletContainer").innerHTML = "<applet ... />";

of course you'd need the element to exist so somewhere in your DOM you'd have:

<div id="appletContainer"></div>

as an empty element waiting to be populated.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.