在同一页面通过Javascript函数加载Applet

发布于 2024-12-08 05:27:21 字数 324 浏览 1 评论 0原文

我正在尝试通过 javascript 按需加载小程序。

这是我尝试过的:

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

问题是它在新页面中加载小程序。我需要它在同一页面上打开它,以便保留小程序生成的会话密钥。

有没有办法让小程序在同一页面上加载?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

行至春深 2024-12-15 05:27:21

您是否尝试过类似的操作:

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

当然,您需要该元素存在,因此在 DOM 中的某个位置您将:

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

作为等待填充的空元素。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文