实例字段原生JS全局

时间:2010-11-02 04:27:22

标签: javascript gwt field

<script type="text/javascript">
var a = 0;
</script>

现在我有GWT:

public class AA implements EntryPoint {

  public final int a =44;

}

如何将实例字段a传输到本机全局javascript变量,以便可以从javascript方法调用它?

1 个答案:

答案 0 :(得分:2)

public native void init ( Integer arg )/*-{
    $wnd.a = arg;
}-*/;