我如何读取 HTML 文件并使用其 css 和 Javascript 在 GWT 中显示内容

发布于 2024-12-27 17:38:03 字数 366 浏览 2 评论 0原文

我只想读取 HTML 文件并在 GWT 小部件中显示其内容。我已经完成了,但我没有得到它的 css 和 javascript。那么有人可以帮我获取带有 css 和 javascript 的内容吗?

我尝试了以下代码,

public class FrameExample implements EntryPoint {

  public void onModuleLoad() {

    Frame frame = new Frame("http://www.google.com/");
     RootPanel.get().add(frame);
   }
}

我只得到了一个矩形框。但我没有得到预期的结果。你能帮助我吗?

I just want to read a HTML file and display its content in a GWT widget. Already I have done it but i'm not getting its css and javascripts. So can anyone help me to get the content with its css and javascripts?

I tried the following code,

public class FrameExample implements EntryPoint {

  public void onModuleLoad() {

    Frame frame = new Frame("http://www.google.com/");
     RootPanel.get().add(frame);
   }
}

I got a rectangular box only. But I don't get the expected result. Can you help me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

反话 2025-01-03 17:38:03

忘记我所说的一切,您可以在这里找到答案!
Iframe 不显示某些页面

基本上:谷歌有一种机制来检测它是否是不托管在 iframe 中。这当然提出了一个问题,为什么他们在示例中使用它......

顺便说一句:像 http://en.wikipedia.com 这样的网站可以工作。

Forget everything I said, you can get the answerer here!
(Iframe not displaying some pages)

Basically: google has a mechanism to detect if it is not hosted in a iframe. This of course raises the question why they us it in their examples.....

BTW: a site like http://en.wikipedia.com works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文