issue injecting gwt .js file from webserver to webpage

4 views
Skip to first unread message

chewy

unread,
Nov 24, 2009, 11:37:44 AM11/24/09
to Google Web Toolkit
Hi,

I have built my application in GWT and the resulting .js file, I want
to inject to my web page.
This works fine locally.

But when I put the GWT .js file on my webserver and use <script
type="text/javascript" language="javascript" src="http://
mywebserver.com/myApp.nocache.js"></script> to call the .js file and
inject to my web page - firefox gives me security errors.

Now from reading the forums, there is a cross domain issue here - but
in reality there is no issue as I built the same javascript app
manually and located it on my webserver and called the .js file from
another webpage on another server - the app worked with out any error.
So why does the .js files produced by the GWT cause these security
errors.
anybody have a work around?

thanks for your help

C

Thomas Broyer

unread,
Nov 24, 2009, 1:05:40 PM11/24/09
to Google Web Toolkit
That's because GWT actually load your app in a hidden iframe; because
the iframe isn't in the same domain ("origin" actually) as your "host
page", they cannot communicate.

> anybody have a work around?

Let's rather call it a solution (*the* solution, at least the blessed
one): add the following in your module:

<add-linker name="xs" />

(unfortunately, the documentation isn't up-to-date and still
references the 1.4.x way of doing things)

chewy

unread,
Nov 25, 2009, 4:40:20 AM11/25/09
to Google Web Toolkit
Thank you , thank you , thank you.

and bless your cotton socks!

C
> references the 1.4.x way of doing things)- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages