在两个及更多 HTML 托管页面中加载 GWT 模块
有谁知道如何在两个不同的 HTML 页面中加载相同的 GWT 模块以及是否必须修改脚本标记或类似的事情?
Does any one has an idea how to load same GWT module in two different HTML pages and if the script tag has to be modified or some thing like that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将脚本标签复制到要加载模块的每个页面即可。
如果您需要历史记录支持,您还必须复制该历史记录 iframe。您从主页链接的任何 css 文件也需要复制。
附录:如果您尝试通过原始主机文件中定义的 ID 访问任何元素,则还需要在第二个主机文件中定义这些元素。例如,如果您使用 RootPanel.get("specialDivName") 在主页中查找
,则必须确保该 div 位于第二个主页也是如此。
Just copy the script tag into each page you want to load the module.
If you need history support, you'll also have to copy that history iframe. Any css files you link from the host page also need to be copied.
Addendum: If you try to access any elements by ID that are defined in your original host file, you also need to define those elements in the second host file. For example, if you use RootPanel.get("specialDivName") to find a
<div id="specialDivName">
in the host page, you've got to make sure that div is in the second host page as well.