简体   繁体   English

Java 8 Update 91问题

[英]Java 8 Update 91 Issue

While applet initializing when using isActive() method. 使用isActive()方法时applet初始化。 It only return undefined. 它只返回undefined。 This problem only comes "Java 8 Update 91". 这个问题只出现在“Java 8 Update 91”中。 Can anyone tel me the solution to fine applet loaded or not? 任何人都可以打电话给我加载的精美applet的解决方案吗?

I have used the following code: 我使用了以下代码:

function isAppletActive(app) {
 var active = false; 
 try { active = app.isActive(); // IE check }
 catch(ex) { 
 try { active = app.isActive; // Firefox check }
   catch(ex1){ } } //alert(active); return active; 
}

This is a bug in either Firefox (most likely) or Java 8_91. 这是Firefox(最有可能)或Java 8_91中的错误。 It appears that any premature call to the applet's method hoses the link to the applet permanently. 似乎对applet方法的任何过早调用都会永久地隐藏到applet的链接。

However, the applet support has a new feature for checking applet status, enabled by setting parameter <param name="java_status_events" value="true"/> . 但是,applet支持有一个用于检查applet状态的新功能,通过设置参数<param name="java_status_events" value="true"/>启用。 This in turn allows status to be checked while the applet is loading. 这反过来允许在加载applet时检查status If you enable this, and use it to prevent any applet method being called until the applet loads, it all works. 如果启用此功能,并使用它来阻止在applet加载之前调用任何applet方法,则一切正常。

function isAppletActive(app) {
    // assuming `app` is the applet element...
    if(app.status==1) { return false; } // still loading
    if(app.status==2) { throw "Applet load failed"; }

    try { active = app.isActive(); } // IE check 
    catch(ex) { 
        try { active = app.isActive; } // Firefox check 
        catch(ex1) { /* NEVER swallow exceptions! */ } 
    } 
    //alert(active); 
    return active;
}

And just BTW, Firefox uses app.isActive() , not app.isActive , though who knows what it did in the past. 而且只是BTW,Firefox使用app.isActive() ,而不是app.isActive ,尽管谁知道它过去做了什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM