我开发了一个小程序,并在它完成某些任务时重新加载它。我使用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 代码来重置小程序 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