问题
How can I load html page and insert its content into div element? I don't want to use ContentPanel.setUrl (for example), because it will create IFrame Is it possible?
回答1:
Simply use Gxt's HtmlContainer
class and it's setUrl()
method:
http://dev.sencha.com/deploy/gxt-2.2.1/docs/api/com/extjs/gxt/ui/client/widget/HtmlContainer.html#setUrl(java.lang.String)
回答2:
Yes, use RequestBuilder go get content of given url:
http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/DevGuideHttpRequests
Remember about same origin policy - if you want to get content of a page from other domain then you will need to write GWT service which will make the server download the content and return to your application through RPC.
来源:https://stackoverflow.com/questions/5897348/load-html-from-url-into-div-java-gwt-gxt