从 Java Applet 调用 JavaScript 函数的最佳方法
我使用 JSNI 将方法导出到 javascript 窗口,并且我想从 GWT 应用程序中的小程序调用此函数。
我认为有时我在 Window 上下文方面遇到问题,所以,我做了一些研究并找到了 JSObject类。
我担心包名称(netscape.javascript
)。这个类还可以用吗?还有其他更好的方法吗?
我已经尝试获取小程序上下文并显示新的 URl(使用 javascript:myFunction();
),但是,在某些浏览器中,它将用户重定向到新的空白窗口...
我能做什么使其尽可能发挥最佳作用?
提前致谢。
I export a method to javascript window with JSNI, and I want to call this function from a applet in a GWT application..
I think that sometimes I have problems with Window context, so, I do some research and found the JSObject
class.
I afraid with the package name (netscape.javascript
). Is this class still be used? Is there another better way to do this?
I already tried to get applet context and show a new URl (with javascript:myFunction();
), but, in some browsers it redirects the user to a new blank window...
What can I do to make it works best as possible?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,每个 Oracle JRE 都包含
netscape.javascript
包。不完全确定其他人。The
netscape.javascript
package is included with every Oracle JRE that I am aware of. Not entirely sure about the others.