gwt调用iframe的方法和变量

来源:互联网 发布:淘宝余姚司法拍卖网 编辑:程序博客网 时间:2024/06/06 04:56

不多说了直接上码:

//调用方法

private native void methodName()/*-{        var childrenIframe = $wnd.document.getElementById("id");        var win = childrenIframe.window || childrenIframe.contentWindow;        win.fatherMethodName();    }-*/;

//调用变量

private native boolean methodName()/*-{        var childrenIframe = $wnd.document.getElementById("id");        var win = childrenIframe.window || childrenIframe.contentWindow;        return win.fieldName;    }-*/;
0 0