开发者

cross domain gwt?

is there a way to run gwt on a proxy loaded web page ?

ex) using proxy script on myexamplesite.com that loads finance.google.com, and running GWT on the newly loaded page.

I've been doing the above before I found about GWT, using LAMP stack + Jquery (UI), which quickly turned out to be crap and inefficient. All this trouble to bypass browser's default Single Origin Policy.

So, right now, is it possible to overcome this problem with GWT ? Is it possible to some how, run javascript on a html page from finance.google.com loaded into myexamplesite.com's frame with GWT or other solution?

I am n开发者_C百科ot looking to do JSON or RSS related topics. What I need is high lighted in bold. Is GWT + Gears what I should be using ?

Thank you.


If i understand correctly, you want to be able to manipulate the contents of a frame originating in an external domain, using JavaScript.

As you know, this isn't supported by browsers, because of the same origin policy.

You can only make this work whenever you're able to dictate the contents of the framed page. So if you were a developer for finance.google.com, you could use some techniques to enable cross-domain frame communication.

In your case, to make this work you have to actually proxy finance.google.com, e.g. have your server fetch the contents of finance.google.com and inject custom JavaScript.


I think he's referring to the CORS technique, it would require XmlHttpRequest with the capability to send the Origin in the header (XDomainRequest on IE) and it also requires server side support. This way you don't need to proxy.


I'm not quite sure I understand what you want to achieve (and why), but I think you should try the xs linker. In your module XML file add these two lines:

<inherits name="com.google.gwt.core.Core" />
<add-linker name="xs" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜