Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7164805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:08:11+00:00 2026-05-28T14:08:11+00:00

I just found the joy of communicating from one iframe to another using html5’s

  • 0

I just found the joy of communicating from one iframe to another using html5’s postMessage.

However, the problem I’m having is that I’m running a GWT application that loads the iframe (with external domain). From that external domain I now want to post a message back to the GWT application. Naively I first tried:

parent.postMessage('hello', '*');

from the external script, while listening to message events in my GWT application. This doesn’t work because GWT’s javascript runs itself in an iframe.

The way I got it working is by doing:

document.getElementById(myGwtModuleName).postMessage('hello', '*');

Great that it’s working but what if I would decide to change my Gwt’s module name? The whole process would break and in a year it would probably take a lot of head scratching to figure out why..

Is there a better way to post a message back to the GWT application? Or alternatively how can i figure out what Gwt’s module name is at runtime? In that case I could pass it as a parameter to the iframe.

Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:08:11+00:00Added an answer on May 28, 2026 at 2:08 pm

    had the same problem and took me while but you have to call this, to get it working 🙂

    here is the solution

        public final native void doPost() /*-{
        $wnd.parent.postMessage("Hello parent from your GWT iFrame!", '*');
    }-*/;
    

    Regards,
    Stefan

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just found myself absent-mindedly using from as an identifier. I realise that it
I just found out about superfish and currently using it on an asp.net. The
Just found a piece of my code that had one original typo in it.
I just found the CSS @page directive, and using it with :first to apply
I just found this statement: One can greatly increase the performance of compareTo by
I just found out this code from a tutorial for matrix addition in c++
I just found CompletionService in this blog post . However, this does't really showcases
Just found StyleCop, looks like something worth using for my projects. Then I found
I just found out this problem, it was because of <a herf=javascript:void(0)> ! I
Just found out that when I pressed up in my cmd one of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.