在 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
方法时,我有异常。