executing native javascript within an iframe

15 views
Skip to first unread message

Kevin Cunningham

unread,
Jul 11, 2011, 3:52:55 PM7/11/11
to Google Web Toolkit
I have an application which is being displayed in an iframe and I need
to call a native function from it. If I run the application not in the
iframe, the code runs. But if it is in the iframe, it doesn't.

public native void PrintTop() /*-{
alert("test");
//$wnd.PrintTop();
}-*/;

The alert shows if accessed directly, but not from within the iframe.

yes2000

unread,
Jul 11, 2011, 10:28:32 PM7/11/11
to google-we...@googlegroups.com
Iframe means another window context.

You show invoke "window.parent.PrintTop();" instead.
Reply all
Reply to author
Forward
0 new messages