gpt4 book ai didi

java - 使用 javascript 重新加载小程序时出现问题

转载 作者:太空宇宙 更新时间:2023-11-04 07:35:09 24 4
gpt4 key购买 nike

我开发了一个小程序,当它完成某些任务时我重新加载它。我使用 javascript 实现了这一点:

function startApplet() {
// code to setup "object" tag
var appletHtml = '<object name= ....'
document.getElementById("applet_tag").innerHTML = appletHtml;
}

function restartApplet() {
if (document.getElementById("applettag")) {
document.getElementById("applet_tag").innerHTML = '';
}
startApplet();
}

这在某些机器上工作得很好,但在其他机器上,JavaScript代码被执行,但小程序不会重新加载(消失当前实例,启动一个新实例)

我已经尝试过 <param name="cache_option" value="no">或者使用jquery代码重置applet div没有成功。

有人知道这个问题或者知道另一种在不刷新页面的情况下重新加载小程序的方法吗?

<小时/> 编辑:有关问题的更多信息:

查看 Java 控制台,我推断该小程序有效地重新启动,但我认为我需要该小程序在新的 JVM 实例中重新启动。下面,我附上了 java 控制台的摘录:

basic: Applet loaded.
...
basic: Applet initialized
basic: Starting applet
...
basic: Applet started
basic: Told clients applet is started
basic: Starting applet teardown
basic: Finished applet teardown
basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@d062ed
basic: PluginMain.unregisterApplet: 1 from mananger sun.plugin2.applet.Applet2Manager@ca5165

basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter@185c219
basic: Plugin2ClassLoader.addURL parent called for http://...
basic: Applet loaded.
basic: Applet resized and added to parent container
basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 359544 us, pluginInit dt 55298741 us, TotalTime: 55658285 us
Applet inicializado
basic: Applet initialized
basic: Starting applet
basic: completed perf rollup
basic: Applet made visible
basic: Applet started
basic: Told clients applet is started

最佳答案

我在 applet in new jvm 中找到了解决方案,使用separate_jvm小程序参数,官方部署文档在 applet deployment 。谢谢。

关于java - 使用 javascript 重新加载小程序时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16990890/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com