<script type="text/javascript">
var a = 0;
</script>
现在我有GWT:
public class AA implements EntryPoint {
public final int a =44;
}
如何将实例字段a传输到本机全局javascript变量,以便可以从javascript方法调用它?
答案 0 :(得分:2)
public native void init ( Integer arg )/*-{
$wnd.a = arg;
}-*/;