我有一些java腳本來檢查applet是否在加載頁面的其餘部分之前完成加載。它已經工作了多年,現在似乎在Firefox 16和IE 7中失敗。它在IE 8中工作文件。 <applet name> .isAlive()在某些瀏覽器中失敗
有關它爲什麼會崩潰以及可能會修復它的任何建議?
<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>
1)通過'waituntilok()'的外觀,它會循環直到'document.env.isActive()'。它會進入無限循環嗎? 2)'code =「com/deleted/AppletEnvironment.class」'應該是'code =「com.deleted.AppletEnvironment」'。 –
當applet最終加載時,循環終止。 代碼參數一直工作到最近。我是否依賴於某個功能? – Aaron
不知道。 if(document)'&if(document.env)'的結果是什麼?彈出提醒或向頁面寫入內容。應該'name'是'id'? –