使用jsp动态包含时Onload可以提前触发吗?

发布于 2024-08-29 22:12:43 字数 319 浏览 4 评论 0原文

当 jsp 页面包含 jsp 动态包含...

<jsp:include page=”filename.jsp” /> 

...文档 onload 事件(或原型的 dom:loaded 事件)是否可能被过早触发? (即在包含的 filename.jsp 完全加载之前)

我怀疑这种情况的原因可能是包含的文件是单独编译的,并且仅在运行时由指令包含。父 jsp 可能会假设指令本身的加载足以考虑 DOM 已加载 - 包含页面是异步加载的,并且文档可能不会监视其加载。

这是一个合理的担忧吗?

提前致谢

When a jsp page includes jsp dynamic includes...

<jsp:include page=”filename.jsp” /> 

...is it possible that the document onload event (or prototype's dom:loaded event) could get fired too early? (i.e. before the included filename.jsp has fully loaded)

The reason I suspect this may be the case is that the included file is compiled separately and only included by directive at runtime. The parent jsp might assume that loading of the directive itself is sufficient to consider the DOM is loaded - the includes page is loaded asynchronously and its loading is might not be monitored by the document.

Is this a valid concern?

Thanks in advance

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

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

发布评论

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

评论(1

意犹 2024-09-05 22:12:43

这包括服务器端,而不是客户端。这当然不是异步的。客户端收到一个响应。右键单击页面并查看源代码。都是纯 HTML。

如果您在加载时遇到问题,那么它就在其他地方。验证/验证生成的 HTML 输出。

This is included serverside, not clientside. It's certainly not asynchronously. The client receives one response. Rightclick page and view source. It's all plain HTML.

If you have problems with onload, it lies somewhere else. Verify/validate the generated HTML output.

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