Load HTML from URL into DIV (Java, GWT/GXT)

烈酒焚心 提交于 2019-12-11 23:50:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!