最佳调用从Java小程序的JavaScript函数的方式 [英] Best way to call a JavaScript function from an Java Applet

查看:121
本文介绍了最佳调用从Java小程序的JavaScript函数的方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的方法导出为与JSNI JavaScript的窗口,我想打电话给从applet的这一功能在GWT应用程序。

I export a method to javascript window with JSNI, and I want to call this function from a applet in a GWT application..

我觉得有时候我有Window上下文的问题,所以,我做了一些研究,发现了 JSObject 类。

I think that sometimes I have problems with Window context, so, I do some research and found the JSObject class.

我害怕跟包名( netscape.javascript )。是这个类仍然可以使用?是否有另一种更好的方式来做到这一点?

I afraid with the package name (netscape.javascript). Is this class still be used? Is there another better way to do this?

我已经试图让applet上下文,并显示一个新的URL(与的javascript:myFunction的(); ),但是,在一些浏览器是将用户重定向到一个新的空白窗口...

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?

先谢谢了。

推荐答案

netscape.javascript 包是包含在每个Oracle JRE,我是知道的。不完全确信其他人。

The netscape.javascript package is included with every Oracle JRE that I am aware of. Not entirely sure about the others.

这篇关于最佳调用从Java小程序的JavaScript函数的方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆