0

I have some java script to check if applet is finished loading before I load the rest of the page. It has worked for years, and now seems to be failing in Firefox 16 and IE 7. It works in IE 8

Any suggestions on why it has broken and what might fix it?

<applet name="env" archive="portal-applet-envir.jar" code="com/deleted/AppletEnvironment.class" height="1" mayscript="true" width="1">
</applet>
<table width="98%" align="center"><tr><td>
<script language="javascript">
function waituntilok() {
   if (document.env.isActive()) {
     doit();
  }
  else {
      var ct = 0;
      while (! document.env.isActive())
      {
      }
     doit();
   }
}
[....]
waituntilok();
</script>
</td></tr></table>

How do I get devise_async working with Cucumber?

I've followed the instructions for devise_async as per the README and I'm rolling Devise 2.1.2 and delayed_job. In my cucumber tests, I no longer receive the confirmation email as part of the sign-up process. Is there something I should be doing as part of testing? I already set delayed job to skip the actual delay for testing by setting the following in my test environment.

Delayed::Worker.delay_jobs = false

But even with this set to true, it still fails, albeit more slowly. If I remove the devise_async gem and the relevant lines, everything bursts back into life.

Thanks, Graeme

4

1 に答える 1

1

アプレットが初期化される前にdocument.env.isActive()が呼び出されると、FF は「そのようなメソッドはありません」というエラーを登録し、関数を終了します。これらのことをデバッグするときは、エラー コンソールを確認することをお勧めします。

また、アプレットのサイズが 1x1 であることも疑わしいものでした。「疑わしいほど小さい」HTML 要素を削除する、ユーザーを保護するように設計されたツールがあります。

このバージョンは FF で動作します。IE と FF の両方で試して、レポートを返します。

<html>
<body>
<applet
    name="env"
    archive="http://pscode.org/lib/mime.jar"
    code="org.pscode.mime.MimeType"
    height="100"
    mayscript="true"
    width="600">
</applet>
<table width="98%" align="center">
<tr>
<td>
<script language="javascript">
function waituntilok() {
    if (document) {
        alert('document');
    }
    if (document.env) {
        alert('document.env');
    }
    if (document.env.isActive()) {
        doit();
    } else {
        var ct = 0;
        while (! document.env.isActive())
        {
        }
        doit();
    }
}

function doit() {
    alert('Just Do It!');
}

setTimeout('waituntilok()', 15000);
</script>
</td>
</tr>
</table>
</body>
</html>
于 2012-11-16T14:49:50.470 に答える