为什么这个 Java 小程序会崩溃并关闭 IE6?
我正在使用以下 Java Applet 来获取要上传的文件的完整文件路径: SVN LittleShoot。
问题是,小程序已初始化,并且似乎在 IE6 中运行 - 但是当我从 JavaScript 调用其中一个函数到小程序来打开文件对话框时,浏览器崩溃并自行关闭,只是因为显示了对话框。
为什么会这样呢?我如何调试这个,我没有任何日志文件可供查看?可能是什么原因 - 我愿意在这里进行疯狂的猜测,因为我很绝望!
HTML 用法(删除 JS):
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" id="LittleShootApplet" name="LittleShootApplet" width="0" height="0">
<PARAM name="code" value="LittleShootApplet" />
<PARAM name="scriptable" value="true" />
<PARAM name="mayscript" value="true" />
<PARAM name="style" value="xdisplay: none; width:0; height:0; padding:0; margin:0;" />
</OBJECT>
更新
我现在收到此错误:“对象不支持此属性或方法。”我认为它正在谈论这条线。
<input type="button" value="Browse.." onclick="document.LittleShootApplet.openDialog('onFileDialogFile', 'onFileDialogCancel');">
仅使用 HTML 版本,我收到 JS 错误!
I am using the following Java Applet to get the full file path of a file that is to be uploaded: SVN LittleShoot.
The thing is, the applet is initialized and it seems to be running in IE6 - but when I call one of the functions from JavaScript to the applet to open the file dialog box the browser crashes and closes itself just the dialog because shows up.
Why is the case? How can I debug this, I don't have any log files to look at? What may be the cause - I am willing to take wild guesses here as I am desperate!
HTML Usage (removed JS):
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" id="LittleShootApplet" name="LittleShootApplet" width="0" height="0">
<PARAM name="code" value="LittleShootApplet" />
<PARAM name="scriptable" value="true" />
<PARAM name="mayscript" value="true" />
<PARAM name="style" value="xdisplay: none; width:0; height:0; padding:0; margin:0;" />
</OBJECT>
Update
I get this error now: "Object doesn't support this property or method." I think its talking about this line.
<input type="button" value="Browse.." onclick="document.LittleShootApplet.openDialog('onFileDialogFile', 'onFileDialogCancel');">
Using just the HTML version, I get a JS error!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您从 Applet 本身内部放入一些测试调用,会发生什么:进行与 JS 调用挂钩的相同调用?这也崩溃吗?
如果它没有崩溃,那么我会说你在浏览器本身中发现了一个错误(或“LiveConnect” - 无论孩子们现在如何称呼 Java<->JS 通信..)
如果是这样的话,我建议如下:
简化 Applet,使其包含最少量的代码,以免崩溃:JSScript 也是如此。
让它崩溃 - 然后你会被困在调试 Windows 程序中,我认为:
http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx
What happens if you put in some test calls from within the Applet itself: to make the same call that the JS calls hook into ? Does this also crash ?
If it doesn't crash, then I would say you have found a bug in the browser itself (or 'LiveConnect' - whatever the kids are calling Java<->JS communication these days..)
If that it is the case, I would suggest the following:
Simplify the Applet, so that it contains the minimum amount of code in order that it crashes: same goes for the JSScript.
Get it to crash - then your stuck with debugging a Windows program I think:
http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx
打开 Java 控制台并加载小程序。转到控制面板>爪哇>高级并启用调试和控制台
Open the Java Console and load the applet. Go to the Control Panel > Java > advanced and enable debugging and the console
您似乎说仅打开 Java 控制台也会导致崩溃?
如果是这种情况,请参阅 Sun 网站上的此帖子:
https://bugs .java.com/bugdatabase/view_bug?bug_id=6563344
You seem to say that just opening up the Java Console causes a crash as well ?
If that is the case , see this posting on the Sun Web Site:
https://bugs.java.com/bugdatabase/view_bug?bug_id=6563344