1

在 Javascript 中,我可以写:

var circles = document.all.tags("circle");

在 circles 变量中,我将有一个圆形标签列表。

我怎样才能在 GWT 中做到这一点?我写:

public final native void getPoints() /*-{
    this.points = $doc.all.tags("circle");
}-*/;

public final native String toJSON() /*-{
    return $wnd.JSON.stringify(this);
}-*/;

但是当我调用toJSON方法时,我有异常。

4

1 回答 1

1

您在Document类中有getElementByTagName() 。

于 2012-01-05T11:27:53.750 回答